Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting all sheets

Status
Not open for further replies.

dbsquared

Programmer
Nov 7, 2002
175
US
Using VBA in Excel 2002 I want to select all the sheets in a workbook.

The sheets.select wants me to list all the sheet names. I will be changing the names of the sheets as I go along so that won't work. So I need a function that will just select them all.
Any help would be appreciated.
Thanks

Dan To go where no programmer has gone before.
 
use
sheets.select
to select all sheets,
worksheets.select
to select all worksheets (not chart sheets)
Rob
[flowerface]
 
db

There is a Worksheets collection that has all the sheet objects. You dont' need to select all sheets to work on the collection
Dim sh As Worksheet
For Each sh in Worksheets
'all the stuff for each sheet, sh
Next

Hope this helps :) Skip,
SkipAndMary1017@mindspring.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top