View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas Gary Keramidas is offline
external usenet poster
 
Posts: 2,494
Default VBA to Select All Visible Sheets

this would select all of the sheets

Worksheets.Select


--


Gary


"bill_morgan" wrote in message
...
Hi ....

I need to write VBA code that will select all visible sheets in the
workbook, and then change the page setup settings. Is there a simple VBA
command to select all visible sheets or do I need to use a variation of the
following:

Sheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5")).Select

- in which case I will need to loop through the workbook names and build
the string since I don't know the sheet names. There are approx 40 sheets in
each file.

Thanks for your assistance ....