Bonjour,
J'ai une maccro permettant d'écrire des 1 dans des cases en fonction des jours du mois renant en compte les jours de congés et férié et les Samedis noté S et les dimanches noté D
Ma macro fonctionne bien pour le 1er mois (en l'occurance Colonne 35 à colonne 65 (mois de septembre)) mais pas pour les mois suivants.
Comment puis-je lui dire de faire des boucles sachant que certains mois il y a 30j ou 28/29j ou 31j
Merci de votre aide
ElseIf Worksheets(tableau).Cells(pRow, pVerifCol) = "M" Then
rechercheCol = 35
While Worksheets(tableau).Cells(3, rechercheCol) <> ""
If Day(Worksheets(tableau).Cells(3, rechercheCol)) = 1 Then
mi1 = mi1 + 1
mCol = rechercheCol - 2
mPlus = 0
mti:
cClean = False
While Worksheets(feuilleConges).Cells(congesRow, mCongCol + Worksheets(tableau).Cells(pRow, pRefCol) + mPlus) <> ""
mPlus = mPlus + 1
cClean = True
Wend
If Worksheets(tableau).Cells(2, mCol + Worksheets(tableau).Cells(pRow, pRefCol) + mPlus) = "S" Then
mPlus = mPlus + 2
cClean = True
End If
If Worksheets(tableau).Cells(2, mCol + Worksheets(tableau).Cells(pRow, pRefCol) + mPlus) = "D" Then
mPlus = mPlus + 1
cClean = True
End If
If cClean Then GoTo mti
Worksheets(tableau).Cells(pRow, mCol + Worksheets(tableau).Cells(pRow, pRefCol) + mPlus) = 1
mPre = Worksheets(tableau).Cells(pRow, pRefCol)
End If
rechercheCol = rechercheCol + 1
Wend