J'avais zappé cette question que je n'avais pas comprise !
par contre j'aurai une autre question, peut-on délimiter une zone bien précise lors de la sélection de cellule
Sub RTT()
Dim Cellule As Object
Dim Ctr As Integer
Application.ScreenUpdating = False
For Each Cellule In Selection
Ctr = Ctr + 1
Cellule = Ctr
Selection = "RTT"
Selection.Interior.ColorIndex = 27
Selection.Font.Bold = True
Next
Application.ScreenUpdating = True
End Sub
J'aimerai que cette zone s'applique uniquement à partir de la colonne f a ap.
Oui c'est possible
jusque AP ou PQ (433ème colonne) ?
si à partir de F jusque PQ =
Sub RTT()
Dim Cellule As Object
Dim Ctr As Integer
Application.ScreenUpdating = False
For Each Cellule In Selection
If Cellule.Column > 6 And Cellule.Column < 434 Then
Ctr = Ctr + 1
Cellule = Ctr
Cellule = "RTT"
Cellule.Interior.ColorIndex = 27
Cellule.Font.Bold = True
End If
Next
Application.ScreenUpdating = True
End Sub
edit : note aussi que tu dois remplacer selection par cellule
Au passage, il y a pas mal de macros relatives aux codes d'absence.
Il est possible de toutes les remplacer par une seule :
Sub renseigner()
Dim Cellule As Object
Application.ScreenUpdating = False
For Each Cellule In Selection
If Cellule.Column > 6 And Cellule.Column < 434 Then
Cellule = ActiveSheet.Shapes(Application.Caller).TextFrame.Characters.Text
Cellule.Interior.Color = ActiveSheet.Shapes(Application.Caller).Fill.ForeColor.RGB
Cellule.Font.Bold = True
End If
Next
Application.ScreenUpdating = True
End Sub
Cette macro met alors dans les cellules sélectionnées le texte et la couleur du bouton !
J'ai supprimé Ctr dot je ne vois pas l'intérêt.