I need to return the name of a worksheet in another worksheet cell?

R

Rick

This is either very easy or just can't be done.
I want the first worksheet in a workbook to display a list of the other
worksheet's name.

Within Sheet1
cell A5 should return the name of Sheet2 (as renamed on the tab)
cell A6 should return the name of Sheet3
and so forth

Any ideas would be very much appreciated.

Thanks, Rick
 
A

abcd

dim Sh as worksheet, r as range
Set R = Range("A5")
for each Sh in Sheets
R.value = Sh.name
set R = R.offset(1,0)
next
 
A

abcd

If you want my macro to works fine with many books opened even when
selecting an other book you can specify the book

replace "in Sheets" by "in ThisWorkBook.Sheets"
or specifie a choosen book
 

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