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
|
Sub MiseEnFormeCellulesFormationV2(ByVal FeuilleFormation As Worksheet, ByRef CelluleEnCours As Range)
Dim LigneEnCours As Long, LigneDeTitre As Long, DerniereLigne As Long
On Error GoTo Fin
Application.ScreenUpdating = False
LigneEnCours = CelluleEnCours.Row
With FeuilleFormation
LigneDeTitre = 10
DerniereLigne = .Cells(.Rows.Count, 1).End(xlUp).Row
If DerniereLigne <= LigneDeTitre Then
MsgBox "Pas de formation dans le tableau !", vbCritical
GoTo Fin
End If
For LigneEnCours = LigneDeTitre + 1 To DerniereLigne
If .Cells(LigneEnCours, 1) = CelluleEnCours Then
MiseEnFormeCellulesFormation FeuilleFormation, LigneEnCours
End If
Next LigneEnCours
Application.ScreenUpdating = True
' MsgBox "Fin de mise en forme !", vbInformation
End With
CelluleEnCours.Select
Fin:
Application.ScreenUpdating = True
End Sub |
Partager