Bonjour,
Mon code ci-dessous me permet d'afficher des "1" dans la premiere semaine (colonne 34 à 39) selon quelques conditions.
Je voudrais répeter la macro en faisant hcol=hcol+7 et hConCol = hCongCol +7
Repeter jusqu'à ligne 3 colonne X vide
Comment puis-je réaliser cette boucle ?
(Le code est plus complet que ça d'où les "..."
congesRow = 7
tableau = "PlanningHebdo"
feuilleConges = "Congés"
'---Hebdomadaire----------
hcol = 34
hCongCol = 253
hPlus = 0
hVerif = False
hPre = 0
'---Planning-------
pRefCol = 10
pVerifCol = 3
pRow = 5
break = True
....
ElseIf Worksheets(tableau).Cells(pRow, pVerifCol) = "H" Then
hti:
cClean = False
While Worksheets(feuilleConges).Cells(congesRow, hCongCol + Worksheets(tableau).Cells(pRow, pRefCol) + hPlus) <> ""
hPlus = hPlus + 1
cClean = True
Wend
If cClean Then GoTo hti
Worksheets(tableau).Cells(pRow, hcol + Worksheets(tableau).Cells(pRow, pRefCol) + hPlus) = 1
End If
...