ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   I need to return the name of a worksheet in another worksheet cell? (https://www.excelbanter.com/excel-programming/332592-i-need-return-name-worksheet-another-worksheet-cell.html)

Rick[_27_]

I need to return the name of a worksheet in another worksheet cell?
 
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






abcd[_2_]

I need to return the name of a worksheet in another worksheetcell?
 
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

abcd[_2_]

I need to return the name of a worksheet in another worksheetcell?
 
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


All times are GMT +1. The time now is 04:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com