chris09300
Messages postés140Date d'inscriptionlundi 9 juin 2008StatutMembreDernière intervention18 avril 2012
-
9 févr. 2011 à 16:09
chris09300
Messages postés140Date d'inscriptionlundi 9 juin 2008StatutMembreDernière intervention18 avril 2012
-
9 févr. 2011 à 19:15
bonjour
est il possible au lieu de with sheets("Janv") de mettre
with sheets.... feuil. active, car j'utilise cette macro sur plusieurs feuilles, et cela n'ennui un peu d'alourdir ma macro en la recopiant X fois.
si quelqu'un sait comment faire, merci a lui.
chris
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
If Controls("Textbox1") = "" Then
MsgBox "Vous devez ABSOLUMENT indiquer Un Nom !", vbExclamation, _
"ERREUR ... Entrez un Nom SVP !"
Controls("Textbox1").SetFocus
Exit Sub
End If
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
End With
Selection.Merge
Selection = UserForm1.Textbox1
Unload UserForm1
With Selection.Interior
.Color = 65535
End With
With Selection.Font
.ColorIndex = xlAutomatic
Selection.Font.Bold = True
End With
With Sheets("Janv")
For i = 9 To 73
.Range("B" & i) = 0
If .Range("C" & i).Interior.Color 65535 Then .Range("B" & i) .Range("B" & i) + 0.25
If .Range("K" & i).Interior.Color 65535 Then .Range("B" & i) .Range("B" & i) + 0.25
If .Range("R" & i).Interior.Color 65535 Then .Range("B" & i) .Range("B" & i) + 0.25
If .Range("Y" & i).Interior.Color 65535 Then .Range("B" & i) .Range("B" & i) + 0.25
Next i
End With
'With Sheets("Fevr")
' For i = 9 To 73
' .Range("B" & i) = 0
' If .Range("C" & i).Interior.Color 65535 Then .Range("B" & i) .Range("B" & i) + 0.25
' If .Range("K" & i).Interior.Color 65535 Then .Range("B" & i) .Range("B" & i) + 0.25
' If .Range("R" & i).Interior.Color 65535 Then .Range("B" & i) .Range("B" & i) + 0.25
' If .Range("Y" & i).Interior.Color 65535 Then .Range("B" & i) .Range("B" & i) + 0.25
' Next i
'End With
Application.ScreenUpdating = True
Range("A1").Select
End Sub
chris09300
Messages postés140Date d'inscriptionlundi 9 juin 2008StatutMembreDernière intervention18 avril 20121 9 févr. 2011 à 19:15
d'accord, je te remercie de tes infos.
j'ai trouver ce que je voulais faire.
merci encore a toi et a tous ceux qui nous depannent, et sans eux ne finirions pas nos appli.
chris
chris09300
Messages postés140Date d'inscriptionlundi 9 juin 2008StatutMembreDernière intervention18 avril 20121 9 févr. 2011 à 17:24
bonjour
avec le code ActiveSheet je suis oblige de donner une feuille, je souhaiterais avoir avec la feuille active.
si je suis sur Janv la macro marche , si je suis aur la feuil Fevr, et que je lance la macro ca marche aussi, ainsi de suite pour toutes mes feuilles.
merci