chinel
XLDnaute Impliqué
Salut tout le monde !
voici mon code :
macro1
Sub test()
Dim rng As Range
Dim c As Range
Dim mot As String
mot = InputBox("qui?") & "*"
Set rng = Sheets("Planning perso.").Range("A8:G13")
For Each c In rng
If Not IsEmpty(c) And Not c Like mot Then c.Font.ColorIndex = 2
Next
End Sub
macro2
Sub Affiche_Tout()
Dim rng As Range
Set rng = Sheets("Planning perso.").Range("A8:g13")
rng.Font.ColorIndex = 0
End Sub
j'ai trouver ceci sur le forum, c'est super mais j'ai un problème quand je mets les données l'une en dessous de l'autre car j'ai des données qui doivent rester visibles
est il possible de faire la macro en sautant des lignes ?
style comme ceci pr exemple :
macro 1
Sub test()
Dim rng As Range
Dim c As Range
Dim mot As String
mot = InputBox("qui?") & "*"
Set rng = Sheets("Planning perso.").Range("A8:G13")
Set rng = Sheets("Planning perso.").Range("A15:F22")
For Each c In rng
If Not IsEmpty(c) And Not c Like mot Then c.Font.ColorIndex = 2
Next
End Sub
macro 2
Sub Affiche_Tout()
Dim rng As Range
Set rng = Sheets("Planning perso.").Range("A8:g13")
Set rng = Sheets("Planning perso.").Range("A15:F22")
rng.Font.ColorIndex = 0
End Sub
merci de votre aide !!!
voici mon code :
macro1
Sub test()
Dim rng As Range
Dim c As Range
Dim mot As String
mot = InputBox("qui?") & "*"
Set rng = Sheets("Planning perso.").Range("A8:G13")
For Each c In rng
If Not IsEmpty(c) And Not c Like mot Then c.Font.ColorIndex = 2
Next
End Sub
macro2
Sub Affiche_Tout()
Dim rng As Range
Set rng = Sheets("Planning perso.").Range("A8:g13")
rng.Font.ColorIndex = 0
End Sub
j'ai trouver ceci sur le forum, c'est super mais j'ai un problème quand je mets les données l'une en dessous de l'autre car j'ai des données qui doivent rester visibles
est il possible de faire la macro en sautant des lignes ?
style comme ceci pr exemple :
macro 1
Sub test()
Dim rng As Range
Dim c As Range
Dim mot As String
mot = InputBox("qui?") & "*"
Set rng = Sheets("Planning perso.").Range("A8:G13")
Set rng = Sheets("Planning perso.").Range("A15:F22")
For Each c In rng
If Not IsEmpty(c) And Not c Like mot Then c.Font.ColorIndex = 2
Next
End Sub
macro 2
Sub Affiche_Tout()
Dim rng As Range
Set rng = Sheets("Planning perso.").Range("A8:g13")
Set rng = Sheets("Planning perso.").Range("A15:F22")
rng.Font.ColorIndex = 0
End Sub
merci de votre aide !!!