Bonjour à tous,

A partir d'un tableau de 20 lignes 4 colonnes je souhaite récupérer toutes les lignes dont la première case est non vide et ensuite les stocker dans une nouvelle page

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Sub tableauv1()
Dim i As Integer, j As Integer, tableau(20, 4) As String
j = 1
For i = 1 To 20
If IsEmpty(Range("A1").Cells(i, 1)) = False Then
tableau(j, 1) = Range("A1").Cells(i, 1)
tableau(j, 2) = Range("A1").Cells(i, 2)
tableau(j, 3) = Range("A1").Cells(i, 3)
tableau(j, 4) = Range("A1").Cells(i, 4)
j = j + 1
End If
Next i
Application.Workbooks.Open ("\\MCA-SERVEUR\OPCVM\XAVIER\Tests\xaxa.xls")
Range(Range("A1").Cells(1, 1), Range("A1").Cells(size1, 4)) = tableau(20, 4) 
'problème ici lors du degogage quand je veux coller le tableau
End Sub