bonjour, je ne comprend pas voici deux codes le premier fonctionne et le second plante:
Sub Macro1()
Sheets(1).Range("a1").Select
For a = 1 To 10
Do Until ActiveCell = Sheets(2).Cells(a, 1)
ActiveCell.Offset(1, 0).Select
Loop
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Sheets(1).Range("a1").Select
Next
Sub Macro1()
fin = Sheets(1).Range("A65536").End(xlUp)
Sheets(1).Range("a1").Select
For a = 1 To fin
Do Until ActiveCell = Sheets(2).Cells(a, 1)
ActiveCell.Offset(1, 0).Select
Loop
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Sheets(1).Range("a1").Select
Next
End Sub
dans le deuxieme je rajoute juste: fin = Sheets("erreur").Range("A65536").End(xlUp) et
For a = 1 To fin
Pourriez vous me donner une solution pour que la deuxieme ne plante plus
Merci infiniment de votre aide
End Sub
Sub Macro1()
Sheets(1).Range("a1").Select
For a = 1 To 10
Do Until ActiveCell = Sheets(2).Cells(a, 1)
ActiveCell.Offset(1, 0).Select
Loop
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Sheets(1).Range("a1").Select
Next
Sub Macro1()
fin = Sheets(1).Range("A65536").End(xlUp)
Sheets(1).Range("a1").Select
For a = 1 To fin
Do Until ActiveCell = Sheets(2).Cells(a, 1)
ActiveCell.Offset(1, 0).Select
Loop
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Sheets(1).Range("a1").Select
Next
End Sub
dans le deuxieme je rajoute juste: fin = Sheets("erreur").Range("A65536").End(xlUp) et
For a = 1 To fin
Pourriez vous me donner une solution pour que la deuxieme ne plante plus
Merci infiniment de votre aide
End Sub
