1 2 3 4 5 6 7 8 9 10 11 12 13 14
| objtab = range("A1").currentregion.select ' select du tableau 1
objtab2 = range("C1").currentregion.select ' select du tableau 2
nbligne = objtab.rows.count 'nombre de ligne du tableau 1
nbligne2 = objtab2.rows.count 'nombre de ligne du tableau 2
tab1 = range("A1:nbligne") 'mise en mémoire du tableau 1
tab2 = range("C1:Nbligne2") 'mise en mémoire du tableau 2
for i=1 to nbligne
for j=1 to nbligne2 if tab1(i,1)=tab2(j,1) then 'test de correspondance
tab1(i,2)=tab2(j,2) 'recopie de la valeur
end if
next
next |
Partager