ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how do I get the name of worksheet I just add in macro (https://www.excelbanter.com/excel-programming/306793-how-do-i-get-name-worksheet-i-just-add-macro.html)

jane

how do I get the name of worksheet I just add in macro
 
In macro, I use sheets.add create a new worksheet. I need
to know the name of the worksheet I just created. how can
I do it?

Tom Ogilvy

how do I get the name of worksheet I just add in macro
 
Dim sh as Worksheet
set sh = Worksheets.Add
msgbox sh.Name

--
Regards,
Tom Ogilvy



"jane" wrote in message
...
In macro, I use sheets.add create a new worksheet. I need
to know the name of the worksheet I just created. how can
I do it?





All times are GMT +1. The time now is 03:44 AM.

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