Rename sheet with NOW date
I have a macro recorded that creates a new worksheet (each day) and it will
allow me to rename the new sheet, but I cannot figure out how to make it put the date "NOW" in as the new worksheet's name and leave it named that date forever. Can anyone tell me how to do it? |
Rename sheet with NOW date
Once the new sheet has been activated, run:
Sub name_it() ActiveSheet.Name = Format(Now, "mm-dd-yyyy") End Sub -- Gary's Student gsnu200701 "Publius" wrote: I have a macro recorded that creates a new worksheet (each day) and it will allow me to rename the new sheet, but I cannot figure out how to make it put the date "NOW" in as the new worksheet's name and leave it named that date forever. Can anyone tell me how to do it? |
Rename sheet with NOW date
One way:
Worksheets.Add.Name = Format(Date, "dd mmm yyyy") In article , Publius wrote: I have a macro recorded that creates a new worksheet (each day) and it will allow me to rename the new sheet, but I cannot figure out how to make it put the date "NOW" in as the new worksheet's name and leave it named that date forever. Can anyone tell me how to do it? |
Rename sheet with NOW date
Thanks! Worked like a charm.
"Gary''s Student" wrote: Once the new sheet has been activated, run: Sub name_it() ActiveSheet.Name = Format(Now, "mm-dd-yyyy") End Sub -- Gary's Student gsnu200701 "Publius" wrote: I have a macro recorded that creates a new worksheet (each day) and it will allow me to rename the new sheet, but I cannot figure out how to make it put the date "NOW" in as the new worksheet's name and leave it named that date forever. Can anyone tell me how to do it? |
Rename sheet with NOW date
Sub sheetname1()
Worksheets.Add.Name = Format(Now(), "dddd-mmm-yy") End Sub NOTE: can be done only once a day. Gord Dibben MS Excel MVP On Fri, 12 Jan 2007 13:37:00 -0800, Publius wrote: I have a macro recorded that creates a new worksheet (each day) and it will allow me to rename the new sheet, but I cannot figure out how to make it put the date "NOW" in as the new worksheet's name and leave it named that date forever. Can anyone tell me how to do it? |
All times are GMT +1. The time now is 09:51 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com