Pour compléter ,
Que dois je changer dans ces lignes pour que, lorsque je sélectionne une date,
la macro autorise l'impression d'un rapport qui concerne plusieurs feuilles (nom d'onglets différents)
comportant des lignes concernées par la date requêtée ?
merci pour votre aide.
Option Explicit
Dim ln&, derLn&, dico As Object
Private Sub ComboBox1_Change()
Application.ScreenUpdating = False
Range("2:" & derLn).EntireRow.Hidden = True
For ln = 2 To derLn
If CStr(Range("A" & ln)) = ComboBox1 Then
Rows(ln & ":" & ln).EntireRow.Hidden = False
End If
Next ln
Sheets("Rapport").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Unload Me
Cells.EntireRow.Hidden = False
End Sub
Private Sub UserForm_initialize()
Cells.EntireRow.Hidden = False
derLn = Range("A" & Rows.Count).End(xlUp).Row
Set dico = CreateObject("Scripting.Dictionary")
For ln = 2 To derLn
dico(CStr(Range("A" & ln))) = ""
Next ln
ComboBox1.List = Application.Transpose(dico.keys)
End Sub