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

determine sheet name in a macro

Status
Not open for further replies.
Joined
Jan 28, 2003
Messages
149
Location
GB
Hi

Hopefully this is a really easy question for those of you more familiar with VBA in Excel than I am.

How can I determine the sheet name of the current sheet?

Easy? Please let me know !!!

Cheers

B.M. Blue Monkey
 
I have determined the answer to my query is activesheet.name

Many thanks anyway Blue Monkey
 
Not sure what your trying to acomplish, but you can load the sheet name into a variable with a statement like:

x = activesheet.name

You can then refer to the activesheet as sheets(x). This enables you to jump back & forth to other sheets in the workbook and return to the active sheet. X only retains the information within the active proceedure. If you are jumping out to another proceedure you need to use the Dim x statement in addition.

You can also display the active sheet name in a cell with the statement Range("A1").value = x. Paul Beddows
Avaya Implementation
Telus
Vancouver, Canada
E-mail via
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top