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

XL97 How to find first sheet in workbook using VBA 1

Status
Not open for further replies.

vaneagle

Technical User
Apr 23, 2003
71
AU
Hi,

Does anyone know how to find, using VBA, the first sheet in a workbook?

Issue is that the name of the sheet could be anything. Purely depends on what the user decides to call it!!

Thansk in advance...
 
You could try:
Code:
Dim SName As String
ActiveWorkbook.Sheets(1).Select
SName = ActiveWorkbook.Sheets(1).Name
This should select the first worksheet and populate the variable SName with the sheet name for later use.



Dan.
 
Excellent.

Thanks for that Dan... have a star!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top