a = monthname(lemois) b = monthname(lemoisdefin)
a = monthname(lemois) b = monthname(lemoisdefin)
For each toto in Range (Sheets("" & a).Range("C4:G9"): Sheets("" & b).Range("C4:G9")) If toto.Interior.ThemeColor <> xlThemeColorAccent2 And toto.Interior.TintAndShade <> -9.99786370433668E-02 Then compte = compte + 1 Next toto
datein = Sheets("Fiche Administrative").Range("I9")
dateact = ActiveCell.Value
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range If Not Application.Intersect(Target, Range("F4:I4, C5:I5, C6:I6, C7:I7, C8:H8")) Is Nothing Then Mamacro End Sub
Range (Sheets("" & a).Range("C4:G9"): Sheets("" & b).Range("C4:G9")
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionFor each elmt in ma collection ...... Next
Avant même de passer à une boucle sur tes feuilles, il faudra que ces explications techniques permettent d'y voir suffisamment clair sur une seule feuille !
Dim dep As Integer, fin As Integer dep = 2 fin = 10 For i = dep To fin MsgBox "voir ta feuille nommée " & MonthName(i) & " et y traiter chaque cellule (en boucle, donc) de ta plage de ton choix !" Next
Sub Mamacro() datein = Sheets("Fiche Administrative").Range("I9") dateout = Sheets("Fiche Administrative").Range("i10") suiteb: If ActiveCell < datein Or ActiveCell > dateout Then MsgBox ("Votre sélection n'est pas dans le planning du jeune") GoTo fina End If 'permet de trouver le jour de la semaine année = Year(Date) ancourt = Right(année, 2) reste = ancourt Mod 4 resteutile = (ancourt - reste) / 4 jour = Day(ActiveCell) mois = Month(ActiveCell) If mois 1 Then moise 1 If mois 2 Then moise 4 If mois 2 Then fin 28 If mois 3 Then moise 4 If mois 4 Then moise 0 If mois 5 Then moise 2 If mois 6 Then moise 5 If mois 7 Then moise 0 If mois 8 Then moise 3 If mois 9 Then moise 6 If mois 10 Then moise 1 If mois 11 Then moise 4 If mois 12 Then moise 6 If mois 1 Or mois 3 Or mois = 5 Or mois = 7 Or mois = 8 Or mois = 10 Or mois = 12 Then fin = 31 If mois 4 Or mois 6 Or mois = 9 Or mois = 11 Then fin = 30 If année Mod 4 0 And mois 1 Then ote = 1 If année Mod 4 0 And mois 2 Then ote = 1 fin = 29 End If ote = 0 siecle = 6 somme = ancourt + resteutile + jour + moise - ote + 6 garde = somme Mod 7 If garde 1 Then jour jour + 1 If garde 3 Then jour jour - 1 If garde 4 Then jour jour - 2 If garde 5 Then jour jour - 3 If garde 6 Then jour jour - 4 If garde 0 Then jour jour - 5 jourfin = jour + 4 If jourfin > fin Then jourfin = jourfin - fin fina: Range("g11") = "Du Lundi " & jour & " au vendredi " & jourfin dateact = ActiveCell.Value 'différence entre la date ed la cellule active et la date d'entrée testdate = DateDiff("d", datein, dateact) testdata = DateDiff("ww", datein, dateact) 'enlève les week ends et inclus la date d'entrée testdate = testdate - (testdata * 2) + 1 'je bloque là et c'est du bidouillage ne pas en tenir compte 'je voudrais là avoir mon calcul 'en partant de la date d'entrée, compter le nombre de jour de présence jusqu'à la date sélectionner en retranchant les jours fériés et les vacances qui 'sont en couleur de fond rose pâle (xlThemeColorAccent2 TintAndShade -9.99786370433668E-02) compta: cherche2 = Month(datein) lactive = ActiveCell.Row cactive = ActiveCell.Column lemois = Month(datein) Lemoisdefin = Month(dateact)