This was suggested to me when I inquired about putting checkboxes next to a list to select sheets to print...
here is the code I am using: - I'd love to see what your suggestion looks like. I actually am struggling with this as I want the descriptions next to the checkboxes to be something other than the tab names, since those are semi-cryptic. I had intended to store the description for each box in cell b2, but could not figure out how to modify this to know what the tab name is then. (it looks at the caption and so when I started pulling b2 it broke since it was looking for a tab named that way)
Sub PrintSelectSheets()
Dim i As Integer
Dim TopPos As Integer
Dim SheetCount As Integer
Dim PrintDlg As DialogSheet
Dim StartingSheet As Worksheet
Dim CurrentSheet As Worksheet
Dim cb As CheckBox
DefaultGroupingsAll
Dim NumCopies As String
NumCopies = InputBox(Prompt:="How many copies would you like to print?", Title:="Number of Printed Copies")
application.ScreenUpdating = False
'** Add a temporary dialog sheet
Set StartingSheet = ActiveSheet
Set PrintDlg = ActiveWorkbook.DialogSheets.Add
SheetCount = 0
'** Add the checkboxes
TopPos = 40
For i = 1 To ActiveWorkbook.Worksheets.Count
Set CurrentSheet = ActiveWorkbook.Worksheets(i)
'Skip empty sheets and hidden sheets
If application.CountA(CurrentSheet.Cells) <> 0 And _
CurrentSheet.Visible Then
SheetCount = SheetCount + 1
PrintDlg.CheckBoxes.Add 78, TopPos, 150, 16.5
PrintDlg.CheckBoxes(SheetCount).Text = _
CurrentSheet.Name
TopPos = TopPos + 13
End If
Next i
'Move the OK and Cancel buttons
PrintDlg.Buttons.Left = 240
'Set dialog height, width, and caption
With PrintDlg.DialogFrame
.Height = application.Max _
(68, PrintDlg.DialogFrame.Top + TopPos - 34)
.Width = 230
.Caption = "Select Sheets to Print"
End With
'Change tab order of OK and Cancel buttons
'so the 1st option button will have the focus
PrintDlg.Buttons("Button 2").BringToFront
PrintDlg.Buttons("Button 3").BringToFront
' Display the dialog box
StartingSheet.Activate
application.ScreenUpdating = True
If SheetCount <> 0 Then
If PrintDlg.Show Then
For Each cb In PrintDlg.CheckBoxes
If cb.Value = xlOn Then
Worksheets(cb.Caption).Activate
ActiveWindow.SelectedSheets.PrintOut Copies:=NumCopies
End If
Next cb
End If
Else
MsgBox "All worksheets are empty."
End If
' Delete temporary dialog sheet (without a warning)
application.DisplayAlerts = False
PrintDlg.Delete
'Reactivate original sheet
StartingSheet.Activate
End Sub