Bonjour à tous,

Je souhaiterais copier les valeurs d'un premier tableau et les stocker dans un tableau avec pour nombre de colonne la ligne entière. Puis insérer ce tableau au dessus d'une ligne dont la valeur de la première cellule est "monep". 2 problèmes dans mon code: créer un tableau dont le dimensionnement est 50xligne_entière et copier le tableau à partir de la bonne cellule.

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
17
18
19
20
21
22
 
Sub tableauv1()
Dim i As Integer, j As Integer, tableau(50, ligne_entière) As String
Application.Workbooks.Open ("\\MCA-SERVEUR\OPCVM\VALORISATIONS HEBDO\MOUVEMENTS MONEP\monep.xls")
j = 1
For i = 1 To 200
    If Cells(i, 2).Value = "MCA EUROP' AVENIR" 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)
        tableau(j, 5) = Range("A1").Cells(i, 5)
        j = j + 1
    End If
Next
ActiveWorkbook.Close True
With Worksheets("pointageValo")
ligne = .[A:A].Find("monep", , xlValues, xlWhole).Row
'problème ici
Range("ligne") = tableau()
End With
End Sub
Pouvez-vous m'aidez ?
Merci !