Ryan, you be the messiah! (no offence to all those religious folks)
It works like a dream.
Merci beaucoup.
Keith
Thanks Ryan,
Just 2 little questions;
1) Is there a way with that code you suggested to omit a sheet in the check box list?
(if there is the sheet is called "1 print").
2) Is there a way to highlight (insert ticks) in all boxes?
But once again, many thanks. The solution you gave me was even better than what I had planned.
Keith.
Keith,
Here is an a modified For Next Loop that will take care of what you want. If you take a look at it, it checks the name of the worksheet before it adds it to the dialogbox and if it's name is "1 Print" it will skip it. Second, when it adds each check box, it makes all of their values true, which will put the check in them. Just copy this code. Go into the old code and highlight the same section, and paste this over it. Hope this solves your problems, let me know
Ryan
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
If CurrentSheet.Name <> "1 Print" Then
SheetCount = SheetCount + 1
PrintDlg.CheckBoxes.Add 78, TopPos, 150, 16.5
PrintDlg.CheckBoxes(SheetCount).Text = _
CurrentSheet.Name
PrintDlg.CheckBoxes(SheetCount).Value = True
TopPos = TopPos + 13
End If
End If
Next i
Check out this page. It has a pretty cool solution to your problem. Hope it works, let me know.
Ryan
http://www.j-walk.com/ss/excel/tips/tip48.htm