chinel
XLDnaute Impliqué
Salut tout le monde !
j'ai ceci comme code qui fonctionne bien
mais qand je fais ma recherche je dois absolument mettre une majuscule (pourquoi?) je voudrais qu'on puisse mettre soit des majuscules ou des minuscules et aussi que si mes donnnées sont en gras ou la police en couleur cela ne fonctionne pas !
en résumé : faire une recherche peu importe minuscule ou majuscule
faire une recherche peu importe police en gras ou pas
faire une recherche peu importe police de couleur ou pas
Private Sub CheckBox5_Click()
Sheets("Calendrier").Unprotect
If CheckBox5.Value = True Then
Set f = Sheets("Calendrier")
Dim C As Range
mot = InputBox("pour qui veux-tu imprimer le planning ? n'oublie pas la majuscule !") & "*"
Set rng = f.Range("A8:N11"): Set rng1 = f.Range("A15:N18")
Set rng2 = f.Range("A22:N25"): Set rng3 = f.Range("A29:n32")
Set rng4 = f.Range("A36:h39"): Set rng5 = f.Range("A43:N47"): Set rngP = Application.Union(rng, rng1, rng2, rng3, rng4, rng5)
Application.ScreenUpdating = False
For Each C In rngP
If Not IsEmpty(C) And Not C Like mot Then C.Font.ColorIndex = 2
If Not IsEmpty(C) And Not C Like mot Then C.Interior.ColorIndex = 2
Next
Application.ScreenUpdating = True
Sheets("Calendrier").Activate
Sheets("Calendrier").Visible = True
Application.Dialogs(xlDialogPrinterSetup).Show
Sheets("Calendrier").Range("a2:n47").PrintPreview
Sheets("Calendrier").Visible = False
Application.ScreenUpdating = False
For Each C In rngP
C.Font.ColorIndex = 0
Next
Application.ScreenUpdating = True
CheckBox5.Value = False
If CheckBox5.Value = False Then
End If
End If
End Sub
merci de votre aide !
j'ai ceci comme code qui fonctionne bien
mais qand je fais ma recherche je dois absolument mettre une majuscule (pourquoi?) je voudrais qu'on puisse mettre soit des majuscules ou des minuscules et aussi que si mes donnnées sont en gras ou la police en couleur cela ne fonctionne pas !
en résumé : faire une recherche peu importe minuscule ou majuscule
faire une recherche peu importe police en gras ou pas
faire une recherche peu importe police de couleur ou pas
Private Sub CheckBox5_Click()
Sheets("Calendrier").Unprotect
If CheckBox5.Value = True Then
Set f = Sheets("Calendrier")
Dim C As Range
mot = InputBox("pour qui veux-tu imprimer le planning ? n'oublie pas la majuscule !") & "*"
Set rng = f.Range("A8:N11"): Set rng1 = f.Range("A15:N18")
Set rng2 = f.Range("A22:N25"): Set rng3 = f.Range("A29:n32")
Set rng4 = f.Range("A36:h39"): Set rng5 = f.Range("A43:N47"): Set rngP = Application.Union(rng, rng1, rng2, rng3, rng4, rng5)
Application.ScreenUpdating = False
For Each C In rngP
If Not IsEmpty(C) And Not C Like mot Then C.Font.ColorIndex = 2
If Not IsEmpty(C) And Not C Like mot Then C.Interior.ColorIndex = 2
Next
Application.ScreenUpdating = True
Sheets("Calendrier").Activate
Sheets("Calendrier").Visible = True
Application.Dialogs(xlDialogPrinterSetup).Show
Sheets("Calendrier").Range("a2:n47").PrintPreview
Sheets("Calendrier").Visible = False
Application.ScreenUpdating = False
For Each C In rngP
C.Font.ColorIndex = 0
Next
Application.ScreenUpdating = True
CheckBox5.Value = False
If CheckBox5.Value = False Then
End If
End If
End Sub
merci de votre aide !