Bonjour,

Je parviens à remplir mon tableaux avec ce code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
 
Dim wkbook As Workbook
Dim wksheet As Worksheet
Set wkbook = ThisWorkbook
For j = 1 To 10
Set wksheet = wkbook.Worksheets("ECX_" & j)
    With wksheet
        last_line = .Cells(first_line, first_column).End(xlDown).End(xlToRight).Row
        last_column = .Cells(first_line, first_column).End(xlDown).End(xlToRight).Column
    End With
Next
tableau= Range(Cells(first_line, first_column), Cells(last_line, last_column))
Par contre lorsque je souhaite l'intégrer dans une boucle with cela ne fonctionne plus :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
 
Dim wkbook As Workbook
Dim wksheet As Worksheet
Set wkbook = ThisWorkbook
For j = 1 To 10
Set wksheet = wkbook.Worksheets("ECX_" & j)
    With wksheet
        last_line = .Cells(first_line, first_column).End(xlDown).End(xlToRight).Row
        last_column = .Cells(first_line, first_column).End(xlDown).End(xlToRight).Column
        tableau= .Range(Cells(first_line, first_column), Cells(last_line, last_column))
    End With
Next
"Erreur d'execution '1004':
La méthode 'Range' de l'objet'_Worksheet' a échoué"

Saurriez-vous éclairer ma lanterne ?

Merci,