• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Printing a Hidden Sheet

Sargekd

New Member
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

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
 

Attachments

  • Print Selection.xlsm
    103.8 KB · Views: 2
Hi:
I have not gone through your workbook, from what I understand from your post you can achieve this by un-hiding the sheet printing it and hiding the sheet again.

something like:
Code:
 With Worksheets(Your print range)
        .Visible = True
        .PrintOut
        .Visible = False
    End With

Thanks
 
Back
Top