remplir cellule suivant condition

T

tracor

Guest
salut le phorum

j'aurai besoin d'un petit coup de main concerant une macro
je m'explique
en colonne B des date avec une MFC suivant la WE et jours fériés
je souhaiterai que dans la colonne C pour chaque jours coloriés par la MFC
un petit Tiret vienne se coller en face du WE ou du jour fériés
j'ai bidouillé ce code mais malheureusement la macro stoppe à la première ligne

Global ligne
Sub CompterCellPleine()
With Sheets("Suivi Cadence")
ligne = 4: While Cells(ligne, 2).Interior.ColorIndex = 40: _
ligne = ligne + 1: Wend: ligne = ligne - 1
.Range("c" + Format(ligne)) = "-"
End With
End Sub

y a t il une âme charitable
pour m'aider
merci d'avance

tracor
 
T

tracor

Guest
salut le phorum

j'ai trouver une solution
voici la macro (a adapter suivant les besoins)

Global ligneproduction
Sub Next_mois()
Sheets("Suivi Cadence").Select
'nouveau mois
Range("C4:H43").Select
Selection.ClearContents
ligneproduction = 4: While Cells(ligneproduction, 2).Value <> "": _
ligneproduction = ligneproduction + 1: Wend: ligneproduction = ligneproduction - 1
'formule
Sheets("Suivi Cadence").Select
Range("c4") = "=IF(WEEKDAY(RC[-1],2)>5,""-"",IF(COUNTIF(Fériés,""=""&RC[-1])>0,""-"",""""))"
Range("c4").Select: Selection.Copy
Range("c4:c" + Format(ligneproduction)).Select: Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False: Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("a1").Select
End Sub

un grand merci à moi même
tracor le champion
 

Statistiques des forums

Discussions
312 584
Messages
2 089 985
Membres
104 328
dernier inscrit
Bocain