how do i get the name of a newly added sheet that i add with Sheets.Add in a vba macro in excel?

D

Daniel

how do i get the name of a newly added sheet that i add with Sheets.Add in a
vba macro in excel?
 
D

David McRitchie

Hi Daniel,
See http://www.mvps.org/dmcritchie/excel/sheets.htm

variable = ActiveSheet.Name
'Rename current Sheet
ActiveSheet.Name = "Renamed14a"
ActiveSheet.Name = "D" & Format(Date, "yyyymmdd")
ActiveSheet.Name = "D" & Format(Range("a1"), "yyyymmdd")
ActiveSheet.Name = "D" & Format(Range("a1"), "yyyy_mmdd_hhmm")Also see http://www.mvps.org/dmcritchie/excel/pathname.htmfor
worksheet solution(s)Since you are familiar with macros you might want to thethe microsoft.public.excel.programming newsgroup--HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]My Excel Pages:
http://www.mvps.org/dmcritchie/excel/excel.htmSearch Page: http://www.mvps.org/dmcritchie/excel/search.htm "Daniel"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top