vous trouverez ci apres le programme que j'essaie de faire le probleme c'est comment utiliser l'argument range lors de l'appel de la procédure
Private Sub plan(ligne As Integer, run As Range)
'condition
If Cells(ligne, 4) = True And Cells(ligne, 5) = False Then
'reinitialiser la ligne
For y = 6 To 19
Cells(ligne, y).Select
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Next y
'selection du plan si oui
For y = 7 To run
Cells(ligne, y).Interior.Color = 255
Next y
End If
End Sub
Sub plantr()
Call plan(4, Q5)
End Sub
Private Sub plan(ligne As Integer, run As Range)
'condition
If Cells(ligne, 4) = True And Cells(ligne, 5) = False Then
'reinitialiser la ligne
For y = 6 To 19
Cells(ligne, y).Select
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Next y
'selection du plan si oui
For y = 7 To run
Cells(ligne, y).Interior.Color = 255
Next y
End If
End Sub
Sub plantr()
Call plan(4, Q5)
End Sub