How do I use check boxes to determine which worksheets to print?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a workbook with 4 worksheets, each containing a separate report that I
have formatted to print. I would like to create a 5th worksheet to use a
print control form. It would haveh check boxes to select the tabs and one
button that would print the selected tabs. Is there a way to do this without
getting to deep into VB? Thanks!
 
Nope... To do this you need to use VBA. There is no way to just record a
macro either. This is custom stuff. It is not really intricate stuff, but it
is custom built, so if you want to proceed let us know and we can give you a
hand...

HTH
 
Let's get into it! Thanks Jim. If I'm going to do it, I should do it right.
 
Add two check boxes and a command button to the sheet from the control
toolbox. Double click the command button ad add the following code:

If CheckBox1 = True Then
Sheets("Sheet1").PrintOut
End If
If CheckBox2 = True Then
Sheets("Sheet2").PrintOut
End If

This is a strat for you anyway...
 
Thanks Jim. How would I end the code?

Jim Thomlinson said:
Add two check boxes and a command button to the sheet from the control
toolbox. Double click the command button ad add the following code:

If CheckBox1 = True Then
Sheets("Sheet1").PrintOut
End If
If CheckBox2 = True Then
Sheets("Sheet2").PrintOut
End If

This is a strat for you anyway...
 
I am not 100% sure what you mean... Your code should look something like
this...

Private Sub CommandButton1_Click()
If CheckBox1 = True Then
Sheets("Sheet1").PrintOut
End If
If CheckBox2 = True Then
Sheets("Sheet2").PrintOut
End If
End Sub

When you click on the button it check the value of the checkboxes and if
they are checked it prints out the appropriate sheet...

HTH
 
I copied the code in but it doesn't seem to be working. Is there something I
can check to see if I have it formatted correctly? Thanks again Jim
Don
 
Is there a code to use that allows all check boxes to be ticked or all tabs
to be printed? I have a worksheet with 18 tabs in it and do not want to have
to tick 18 boxes each time I want all 18 to be printed.

Thanks
 
Also is there a code to untick all boxes if they have already been ticked?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top