![]() |
|
#1
|
|||
|
|||
|
Hi!
I am new to VBE in Excel, so please bare with me FYI, I am a Mac Excel 2011 user.I have set up a marco button that when clicked, a pop up displays listing all the active worksheets. The user selects the sheets he/she wants to print, then it prints to the default printer. But I now want to set this up so it saves all selected worksheets to a SINGLE pdf file. Ideally, I would also like it to ask the user what file name he/she wants to save it as. And select a destination. Below is my current code. Any advice would be greatly appreciated. Thank you! Code:
Private Sub CheckBox2_Click()
End Sub
Private Sub CommandButton1_Click()
If CheckBox1.Value = True Then Sheets("Jan").PrintOut Copies:=1
If CheckBox2.Value = True Then Sheets("Feb").PrintOut Copies:=1
If CheckBox3.Value = True Then Sheets("Mar").PrintOut Copies:=1
If CheckBox4.Value = True Then Sheets("Apr").PrintOut Copies:=1
If CheckBox5.Value = True Then Sheets("May").PrintOut Copies:=1
If CheckBox6.Value = True Then Sheets("Jun").PrintOut Copies:=1
If CheckBox7.Value = True Then Sheets("Jul").PrintOut Copies:=1
If CheckBox8.Value = True Then Sheets("Aug").PrintOut Copies:=1
If CheckBox9.Value = True Then Sheets("Sep").PrintOut Copies:=1
If CheckBox10.Value = True Then Sheets("Oct").PrintOut Copies:=1
If CheckBox11.Value = True Then Sheets("Nov").PrintOut Copies:=1
If CheckBox12.Value = True Then Sheets("Dec").PrintOut Copies:=1
If CheckBox13.Value = True Then Sheets("Jan (2)").PrintOut Copies:=1
If CheckBox14.Value = True Then Sheets("Feb (2)").PrintOut Copies:=1
If CheckBox15.Value = True Then Sheets("Mar (2)").PrintOut Copies:=1
If CheckBox16.Value = True Then Sheets("Apr (2)").PrintOut Copies:=1
If CheckBox17.Value = True Then Sheets("May (2)").PrintOut Copies:=1
If CheckBox18.Value = True Then Sheets("Jun (2)").PrintOut Copies:=1
If CheckBox19.Value = True Then Sheets("Jul (2)").PrintOut Copies:=1
If CheckBox20.Value = True Then Sheets("Aug (2)").PrintOut Copies:=1
If CheckBox21.Value = True Then Sheets("Sep (2)").PrintOut Copies:=1
If CheckBox22.Value = True Then Sheets("Oct (2)").PrintOut Copies:=1
If CheckBox23.Value = True Then Sheets("Nov (2)").PrintOut Copies:=1
If CheckBox24.Value = True Then Sheets("Dec (2)").PrintOut Copies:=1
Unload UserForm1
End Sub
Private Sub UserForm_Initialize()
CheckBox1.Caption = Sheets("Jan").Name
CheckBox2.Caption = Sheets("Feb").Name
CheckBox3.Caption = Sheets("Mar").Name
CheckBox4.Caption = Sheets("Apr").Name
CheckBox5.Caption = Sheets("May").Name
CheckBox6.Caption = Sheets("Jun").Name
CheckBox7.Caption = Sheets("Jul").Name
CheckBox8.Caption = Sheets("Aug").Name
CheckBox9.Caption = Sheets("Sep").Name
CheckBox10.Caption = Sheets("Oct").Name
CheckBox11.Caption = Sheets("Nov").Name
CheckBox12.Caption = Sheets("Dec").Name
CheckBox13.Caption = Sheets("Jan (2)").Name
CheckBox14.Caption = Sheets("Feb (2)").Name
CheckBox15.Caption = Sheets("Mar (2)").Name
CheckBox16.Caption = Sheets("Apr (2)").Name
CheckBox17.Caption = Sheets("May (2)").Name
CheckBox18.Caption = Sheets("Jun (2)").Name
CheckBox19.Caption = Sheets("Jul (2)").Name
CheckBox20.Caption = Sheets("Aug (2)").Name
CheckBox21.Caption = Sheets("Sep (2)").Name
CheckBox22.Caption = Sheets("Oct (2)").Name
CheckBox23.Caption = Sheets("Nov (2)").Name
CheckBox24.Caption = Sheets("Dec (2)").Name
End Sub
Last edited by LukeExcelKid; 11-16-2013 at 07:59 PM. |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Macro to save as pdf with ability to choose save as folder
|
rvessio | Word VBA | 4 | 07-25-2016 12:37 PM |
| Change single character in PPT to another font macro | rtwwpad | PowerPoint | 1 | 01-19-2013 05:08 PM |
Macro to save as PDF but with a different name
|
shabbaranks | Word VBA | 2 | 05-20-2011 01:02 AM |
| Macro to Save Help | clarkson001 | Word | 0 | 02-14-2011 06:41 AM |
| Macro Won't Save | lou0915 | Word VBA | 2 | 10-17-2009 08:13 PM |