Bonjour whereisbryan,
Je te propose d'ajouter , q&, p&
au bout de Dim wsbdd As Worksheet
et d'enlever tout ceci (car non utilisé dans ta sub) :
Dim wsmaj As Worksheet
Dim wsmaj2 As Worksheet
Dim flag As Boolean
Set wsmaj = ActiveWorkbook.Sheets("MAJ")
Set wsmaj2 = ActiveWorkbook.Sheets("MAJ2")
Ensuite, remplace :
q = 1
While Not IsEmpty(wsbdd.Cells(q, 18)) = True
If Not IsEmpty(wsbdd.Cells(q, 18)) = True Then
q = q + 1
End If
Wend
par :
q = 1
Do While Not IsEmpty(wsbdd.Cells(q, 18)): q = q + 1: Loop
idem pour l'autre bloc de code similaire, remplace :
p = 1
While Not IsEmpty(wsbdd.Cells(p, 1)) = True
If Not IsEmpty(wsbdd.Cells(p, 1)) = True Then
p = p + 1
End If
Wend
par :
p = 1
Do While Not IsEmpty(wsbdd.Cells(p, 1)): p = p + 1: Loop
J'ai pas testé mais j'crois qu'ça devrait marcher !
dhany