how to get name of worksheet in a workbook?

R

ramsdesk

If I have several worksheets in an Excel file, is there a way to loo
for a particular worksheet (by name) and use it in a formula...

thanks
 
K

Kenjiro Yagi

Hi Ramsdesk,

If you are just trying to enter a formula in a cell. Say you want to get a
value from another sheet, you can type

[name of sheet]![range]

So, if I want to get Cell A1 from sheet named "John"

John!A1

Would work.

If you are trying to use it in VBA, try

Sheets("John").range("A1")

If you want to find out a sheet name

Msgbox Sheets("John").name
Or
Activesheet.name
Etc. etc.

Good luck!

Kenjiro Yagi
http://www.spoofee.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top