1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| 'On pointe sur le tableau pour simplifier les écritures
With Feuil1.ListObjects("Tab_Traitement")
'On boucle sur les lignes du tableau Tab_Traitement
For Each TheRow In .ListRows
'On regarde si la colonne création contien quelques choses
NonCreer = .ListColumns("Création").DataBodyRange.Cells(TheRow.Index, 1) = ""
'On mémorise le pilote et on regarde si affecté
Pilote = .ListColumns("Pilote").DataBodyRange.Cells(TheRow.Index, 1) 'Cells(i, 20).Value
PiloteChoisi = Pilote <> ""
'On teste si la ligne doit être traité
If NonCreer And PiloteChoisi Then
' Entre les données de la NC dans les variables
DateCode = .ListColumns("N° NC").DataBodyRange.Cells(TheRow.Index, 1) 'Cells(i, 2).Value
DateNC = .ListColumns("DATE").DataBodyRange.Cells(TheRow.Index, 1) 'Cells(i, 5).Value
Reference = .ListColumns("PRODUIT").DataBodyRange.Cells(TheRow.Index, 1) 'Cells(i, 6).Value
Designation = .ListColumns("DESIGNATION").DataBodyRange.Cells(TheRow.Index, 1) 'Cells(i, 7).Value
Fournisseur = .ListColumns("CLIENT").DataBodyRange.Cells(TheRow.Index, 1) 'Cells(i, 8).Value
Effet = .ListColumns("NC détectée").DataBodyRange.Cells(TheRow.Index, 1) 'Cells(i, 9).Value |
Partager