Bonjour,
J'ai un petit soucis avec ces like ;
For i = 1 To 12
For j = 1 To 7
If Cells(23, j + 7) Like "*" & i & "*" Then Sheets("Prelevts").Cells(9 + i, 2) = "Bryophytes"
If Cells(23, j + 7) Like "*A" & i & "*" Then Sheets("prelevts").Cells(9 + i, 6) = "A"
If Cells(23, j + 7) Like "*B" & i & "*" Then Sheets("prelevts").Cells(9 + i, 6) = "B"
If Cells(23, j + 7) Like "*C" & i & "*" Then Sheets("prelevts").Cells(9 + i, 6) = "C"
If Cells(24, j + 7) Like "*" & i & "*" Then Sheets("Prelevts").Cells(9 + i, 2) = "Hydrophytes"
If Cells(24, j + 7) Like "*A" & i & "*" Then Sheets("prelevts").Cells(9 + i, 6) = "A"
If Cells(24, j + 7) Like "*B" & i & "*" Then Sheets("prelevts").Cells(9 + i, 6) = "B"
If Cells(24, j + 7) Like "*C" & i & "*" Then Sheets("prelevts").Cells(9 + i, 6) = "C"
Exit For
Next j
Next i
End Sub
Le problème étant que quand i = 10, 11 ou 12 et bien le like considère qu'il y a un 1 ou un 1 et un 2 pour 12, et donc du coup me remplit les cases 1, 2 et 12 alors que je demande que 12.
Alors comment faire pour que like prenne réellement 12 pour 12 et non 1, 2 et 12 ?