Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Daniel
 
Posts: n/a
Default 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?


  #2   Report Post  
Alex
 
Posts: n/a
Default

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?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
data from one sheet to several in sequential order! firecord New Users to Excel 6 June 22nd 05 05:10 PM
Same cell added to master summary sheet Bruce Fry Excel Worksheet Functions 0 April 22nd 05 02:11 PM
relative sheet references ala sheet(-1)!B11 so I can copy a sheet. RonMc5 Excel Discussion (Misc queries) 9 February 3rd 05 12:51 AM
linking multiple sheets to a summary sheet greg g Excel Discussion (Misc queries) 1 December 16th 04 07:43 AM
Naming & renaming a sheet tab Cgbilliar Excel Worksheet Functions 1 November 7th 04 05:57 PM


All times are GMT +1. The time now is 01:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"