View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder[_4_] Rob van Gelder[_4_] is offline
external usenet poster
 
Posts: 1,236
Default selecting multiple sheets

Dennis,

Try this code:

Sub testit()
Dim arr() As Variant, blnResult As Boolean

ReDim arr(1)
arr(0) = "Sheet1"
arr(1) = "Sheet2"
Sheets(arr).Select

blnResult = Application.Dialogs( _
xlDialogPrint).Show(, , , , , , , , , , , 2)
End Sub


I also reference Tom Ogilvy's post about how to show the Print Dialog
(something I never knew about!)
http://groups.google.co.nz/groups?hl...%40tkmsftngp02



"Dennis" wrote in message
...
I am trying to select multiple sheets according to whether
they have any information on them. Ithen want to use the
printdialog box so that the individual can select his
printer.
I have figured out how to close the unnecessary sheets so
if I could get the "entire workbook" radio button to be
clicked upon opening the dialogs box that would work. I
looked through all of the arguments and I see a print_what
argument is available but I cannot seem to figure out what
words to use.
I can make if statements and find the sheets, but the only
way I can get the sheets to print is with Sheets(Array
(?)).Select. I cannot figure out how to change the array
depending on whether I want to select that sheet or not.
Please help if you can.
Dennis