Regueiro
XLDnaute Impliqué
Bonsoir le Forum
Dans mon fichier ci-joint, sur la feuille " PLANNING 1"
Lorsque j'appuie sur le bouton 1
La procédure me remplit automatiquement le Planning.
Avec application.Match il me copie les couleurs selon la BDD.
Mais j'ai un problème de décalage.
Merci de votre Aide.
Dans mon fichier ci-joint, sur la feuille " PLANNING 1"
Lorsque j'appuie sur le bouton 1
La procédure me remplit automatiquement le Planning.
Avec application.Match il me copie les couleurs selon la BDD.
Mais j'ai un problème de décalage.
Merci de votre Aide.
Sub CréerPlanning()
Dim Planning As Range, cell As Range
Dim DateFin As Range, compte&
Set Planning = Range("Planning")
For Each cell In Planning
If Cells(cell.Row, 3).Value <= Cells(4, cell.Column).Value _
And Cells(cell.Row, 5).Value >= Cells(4, cell.Column).Value _
Then
Application.ScreenUpdating = False
'cell.Interior.ColorIndex = 4
p = Application.Match(Cells(cell.Row, 1), Application.Index(Sheets("BDD").[CodeCouleur], , 2), 0)
If IsError(p) Then
Range("CodeCouleur").Offset(, 1).Copy
cell.PasteSpecial (xlPasteFormats)
Application.CutCopyMode = False
End If
End If
Next cell
Application.ScreenUpdating = True
End Sub