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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| Sub CommandButton1_Click()
Dim Cell As Range
Dim lig As Long
Dim col, bat As String
Dim NbrLig As Long
Dim NumLig As Long
Sheets("ARCHIVE").Activate
col = "L" ' colonne données non vides à tester'
NumLig = 1 'le N° de la 1er ligne de données en comptant la ligne 1 = 0
'Sélectionne l'onglet nouvel arrivant
With Sheets("ARCHIVE") 'feuille source'
NbrLig = .Cells(65536, col).End(xlUp).Row
For lig = 2 To NbrLig 'n° de la 1ere ligne de données'
Do While .Cells(lig, col).Value <> ""
' If Then 'si la valeur de la cellule L est non vide
'End If
'For Each Cell In Range("i2:i150") ' il reste sur la colonne I sans vérifier que la colonne L est vide ou pas premiere condition et lance toutes les macros
If Cell.Value = "LIMOGES" Then 'ou activecell.offset(0,-4).value
Call LIMOGES
End If
If Cell.Value = "MARSEILLE" Then
Call MARSEILLE
End If
If Cell.Value = "PARIS" Then
Call PARIS
End If
If Cell.Value = "LONDRES" Then
Call LONDRES
End If
exit do
'Next
Loop
Next
End With
End Sub |
Partager