COULEUR SELON condition

S

serval

Guest
dans tableau ou une feuille je voudrait quechaque fois que jinscrit les mots "h1"ou"h2"ou"h3"ou " h4"ou "h5" ou "h6"ou "h6s" est une couleur attitrer comme une forme conditionnel mais avec plus de 3 conditions MERCI
 
J

Jacky

Guest
Bonjour

Voici une macro pour ton probleme

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Select Case UCase(Target) 'UCASE =
Case "H1"
With Selection.Interior
.ColorIndex = 7
.Pattern = xlSolid
End With
Case "H2"
With Selection.Interior
.ColorIndex = 8
.Pattern = xlSolid
End With
Case "H3"
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
Case "H4"
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Case "H5"
With Selection.Interior
.ColorIndex = 9
.Pattern = xlSolid
End With
End Select

End Sub
 

Discussions similaires

Réponses
7
Affichages
315

Statistiques des forums

Discussions
312 145
Messages
2 085 762
Membres
102 965
dernier inscrit
Mael44