![]() |
how do i get the name of a newly added sheet that i add with Sheets.Add in a vba macro in excel?
how do i get the name of a newly added sheet that i add with Sheets.Add in a
vba macro in excel? |
Daniel
This is one way, but maybe not wholly satisfactory...this is a starting point (maybe) and you can tweak it... Sub getShtName() Dim shtCount As Integer Dim newSht As String shtCount = Worksheets.Count Sheets.Add.Move After:=Sheets(shtCount) newSht = Worksheets(shtCount + 1).Name End Sub This places a new sheet at the end and then gets the name of it. "Daniel" wrote: how do i get the name of a newly added sheet that i add with Sheets.Add in a vba macro in excel? |
All times are GMT +1. The time now is 02:20 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com