View Single Post
 
Old 11-17-2013, 02:39 AM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi LukeExcelKid,

Please be patient - some of us have lives to live outside of answering questions on the net.

If your Mac has a PDF 'printer', try something based on:
Code:
Private Sub CommandButton1_Click()
Dim wkSht As Worksheet, Ctrl As Control, i As Long, ArrShts()
With ActiveWorkbook
  ReDim Preserve ArrShts(0)
  Set wkSht = .ActiveSheet: i = -1
  For Each Ctrl In Me.Controls
    With Ctrl
      If .Name Like "CheckBox#*" Then
        If .Value = True Then
          i = i + 1
          ReDim Preserve ArrShts(i)
          ArrShts(i) = .Caption
        End If
      End If
    End With
  Next
  If UBound(ArrShts()) = 0 Then GoTo NoPrint
  .Sheets(ArrShts).Select
  Application.Dialogs(xlDialogPrint).Show Arg1:=1, Arg4:=1, Arg5:=False, Arg6:=True, Arg7:=1
  wkSht.Activate
End With
NoPrint:
Unload UserForm1
End Sub
 
Private Sub UserForm_Initialize()
CheckBox1.Caption = "Jan"
CheckBox2.Caption = "Feb"
CheckBox3.Caption = "Mar"
CheckBox4.Caption = "Apr"
CheckBox5.Caption = "May"
CheckBox6.Caption = "Jun"
CheckBox7.Caption = "Jul"
CheckBox8.Caption = "Aug"
CheckBox9.Caption = "Sep"
CheckBox10.Caption = "Oct"
CheckBox11.Caption = "Nov"
CheckBox12.Caption = "Dec"
CheckBox13.Caption = "Jan (2)"
CheckBox14.Caption = "Feb (2)"
CheckBox15.Caption = "Mar (2)"
CheckBox16.Caption = "Apr (2)"
CheckBox17.Caption = "May (2)"
CheckBox18.Caption = "Jun (2)"
CheckBox19.Caption = "Jul (2)"
CheckBox20.Caption = "Aug (2)"
CheckBox21.Caption = "Sep (2)"
CheckBox22.Caption = "Oct (2)"
CheckBox23.Caption = "Nov (2)"
CheckBox24.Caption = "Dec (2)"
End Sub
Note the elimination of your redundant 'Sheets().Name' expressions for the captions.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote