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
| Sub MettreAJourLaColonneBAPartirDeLaColonneD()
Dim ShPointage As Worksheet
Dim AireCible As Range
Dim CelluleCible As Range
Dim ColonneCible As Long
Dim ColonneSource As Long
Set ShPointage = Sheets("PointageChéquiers")
Set AireCible = ShPointage.Range(ShPointage.Cells(4, 2), ShPointage.Cells(203, 2))
ColonneCible = AireCible.Column
ColonneSource = 4
AireCible.Interior.Color = xlNone
For Each CelluleCible In AireCible
Select Case CelluleCible.Offset(0, ColonneSource - ColonneCible)
Case "", 0
Case Else
With CelluleCible
' Pour repérer les cellules mises à jour
If CelluleCible <> CelluleCible.Offset(0, ColonneSource - ColonneCible) Then
.Interior.Color = RGB(228, 223, 236)
End If
.Value = CelluleCible.Offset(0, ColonneSource - ColonneCible)
End With
End Select
Next CelluleCible
MsgBox "Fin de mise à jour !", vbInformation, "Mise à jour de la colonne B"
Set AireCible = Nothing
Set ShPointage = Nothing
End Sub |
Partager