1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| Dim WsMag1 as Worksheet
Dim WsMag2 as Worksheet
Dim Ary_StockMag2() as String
Dim Ary_StockMag1() as String
Dim I as long, J as long
Set WsMag1 = Worksheets("FeuilMag1")
Set WsMag2 = Worksheets("FeuilMag2")
With WsMAg1
Ary_StockMag1 = .range(.cells(X, Y), .cells(XX, YY))
End with
'Remplie la variable tableau correspondant au stock 1
With WsMag2
Ary_StockMag2 = .range(.cells(X2, Y2), .cells(XX2, YY2))
End with
'Remplie la variable tableau correspondant au stock 2
For I = Lbound(Ary_StockMag2, 1) to Ubound(Ary_StockMag2, 1)
'Parcours le tableau 2 sur sa première dimensions
For J = Lbound(Ary_StockMag1, 1) to Ubound(Ary_StockMag1, 1)
'Parcours le tableau 1 sur sa première dimensions
If Ary_StockMag2(I, 1) = Ary_StockMag1(J, 1) then
'Si tu trouve une référence qui correspond ...
'Do some stuff
End if
Next J
Next I |
Partager