![]() |
Get sheet name in any workbook
Hello,
I would like to get the name of the first sheet in any workbook that an user chooses. Is this possible? I've tried wb.sheets(1).name. Doesn't work. Please assist. Thanks |
Get sheet name in any workbook
Here is one way right out of VBA help file.
For Each sh In Workbooks("BOOK1.XLS").Windows(1).SelectedSheets If sh.Name = "Sheet1" Then MsgBox "Sheet1 is selected" Exit For End If Next You can also try: ActiveSheet.Name "OffDev" wrote in message ... Hello, I would like to get the name of the first sheet in any workbook that an user chooses. Is this possible? I've tried wb.sheets(1).name. Doesn't work. Please assist. Thanks |
All times are GMT +1. The time now is 11:50 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com