Sub ColorieMon tableau
meyme
Messages postés
5
Date d'inscription
Statut
Membre
Dernière intervention
-
meyme Messages postés 5 Date d'inscription Statut Membre Dernière intervention -
meyme Messages postés 5 Date d'inscription Statut Membre Dernière intervention -
bonjour,
je n'arrive pas a faire fonctionner ma macro... quelqu'un sait comment?
voici le code
Sub ColorieMonTableau(Tableau As Range)
Dim i As Long, n As Long
n = Tableau.Columns.Count
For i = 1 To n Step 2
Tableau.Columns(i).Interior.Color = vbBlue
Next i
For i = 2 To n Step 2
Tableau.Columns(i).Interior.Color = vbYellow
Next i
For i = 1 To n Step 2
Tableau.Columns(i).Font.Color = vbWhite
Next i
End Sub
habituellement je vais dans développeur/macros/ clique sur ma macro mais cette fois-ci je ne la trouves pas
merci!!!!!
je n'arrive pas a faire fonctionner ma macro... quelqu'un sait comment?
voici le code
Sub ColorieMonTableau(Tableau As Range)
Dim i As Long, n As Long
n = Tableau.Columns.Count
For i = 1 To n Step 2
Tableau.Columns(i).Interior.Color = vbBlue
Next i
For i = 2 To n Step 2
Tableau.Columns(i).Interior.Color = vbYellow
Next i
For i = 1 To n Step 2
Tableau.Columns(i).Font.Color = vbWhite
Next i
End Sub
habituellement je vais dans développeur/macros/ clique sur ma macro mais cette fois-ci je ne la trouves pas
merci!!!!!
2 réponses
-
Bonjour,
Ta macro fonctionne à part, probablement, l'adresse de ton tableau.
Comment tu assigne une plage à ton tableau ?
Sinon, essaye ce code et tu verras que tout fonctionne.Sub ColorieMonTableau()
A+
Dim i As Long, n As Long
Dim Tableau As Range
Set Tableau = Range("A1:G20")
n = Tableau.Columns.Count
For i = 1 To n Step 2
Tableau.Columns(i).Interior.Color = vbBlue
Next i
For i = 2 To n Step 2
Tableau.Columns(i).Interior.Color = vbYellow
Next i
For i = 1 To n Step 2
Tableau.Columns(i).Font.Color = vbWhite
Next i
End Sub
-
Salut!
oui sa fonctionne comme ça mais j'aimerais selectionner mon tableau à colorier
avec ce code, il est "fixe"
Merci!