Hi All
My first post here and I am in need of help please.
I have a Workbook with 7 hidden worksheets. Data is input via a separate page called Data Input, I have removed this from the sample attached.
I have two problems I hope someone can help with.
Firstly the code I have to print the monthly information via a Userform and command button only works if All is selected but I need it to work with Al and the Individual drivers if selected. Secondly the sheets will be hidden so the code needs to be able to print All or Individual Drivers from Hidden Worksheets.
Can anyone help please ?
The current code I was given is
Basic Workbook attached here
My first post here and I am in need of help please.
I have a Workbook with 7 hidden worksheets. Data is input via a separate page called Data Input, I have removed this from the sample attached.
I have two problems I hope someone can help with.
Firstly the code I have to print the monthly information via a Userform and command button only works if All is selected but I need it to work with Al and the Individual drivers if selected. Secondly the sheets will be hidden so the code needs to be able to print All or Individual Drivers from Hidden Worksheets.
Can anyone help please ?
The current code I was given is
Code:
Private Sub CommandButton1_Click()
If ComboBox1.Value = "All" Then
DStart = 1: DEnd = ComboBox1.ListCount - 1
Else:
DStart = ComboBox1.Value: DEnd = DStart
End If
For Count = DStart To DEnd
Sheets(ComboBox1.List(Count)).Select
Z = Columns(2).Find(ComboBox2.Value, LookIn:=xlValues, Lookat:=xlPart).Row
ActiveSheet.PageSetup.PrintArea = "B" & Z & ":J" & Z + 20
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False
Next
End Sub
Basic Workbook attached here