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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find all worksheets in a workbook?

Status
Not open for further replies.

xq

Programmer
Jun 26, 2002
106
NL
is there a way to write a macro which can be runed to find all the worksheets in a workbook, then i am able to run other things to do with those worksheets. thanks for any help!
 
xq,

Use the following code to popup names of all sheets in the active workbook:

Sub FindSheetNames()
Dim x
For x = 1 To Sheets().Count
MsgBox Sheets(x).Name
Next x
End Sub


[pc3]
Adam [glasses]
 
All worksheets or only those who matches criteria?

If so, try this

Sub FindActualWorkSheet()
For sh = 1 To ActiveWorkbook.Sheets.Count
if sheets(sh).name=YourCriteria then
............
else
...........
end if
Next
End Sub

Hope it'll help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top