Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Insert Current Date on a Sheet 1 Tab
Good morning.
I have been trying to put a macro in place that will rename Sheet 1 tab to the current date, every day, in many different new workbooks created daily. I know the function =TODAY() however I can't seem to get that function to take on the tab itself. I see that you can Insert an Excel Macro on the tab, but I don't know how to create this either. I can get the Tab to read Macro1 - but then I don't know how to write that Macro. I appreciate any input! -- Thanks! Veronica. |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Insert Current Date on a Sheet 1 Tab
I don't believe you can do that, but I've been proved wrong before. Try this:
http://www.mcgimpsey.com/excel/event...efromcell.html You may get it to work with some modifications but I don't think it is going to work with dates... Regards, Ryan-- -- RyGuy "Veronica" wrote: Good morning. I have been trying to put a macro in place that will rename Sheet 1 tab to the current date, every day, in many different new workbooks created daily. I know the function =TODAY() however I can't seem to get that function to take on the tab itself. I see that you can Insert an Excel Macro on the tab, but I don't know how to create this either. I can get the Tab to read Macro1 - but then I don't know how to write that Macro. I appreciate any input! -- Thanks! Veronica. |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Insert Current Date on a Sheet 1 Tab
hi
you can't name a sheet by a date because you can't use traditions date seperators in the name. these characters are forbidden by excel :, /, \, *,[ ,] you can name it with someting that looks like a date like' 2-12-2008 or Feb-12-2008 and that can be done with a macro. Dim td As Date Dim d As Long Dim m As String Dim y As Long td = Date d = Day(td) m = Format(Month(td), "mmm") y = Year(td) Sheets("sheet1").Name = _ m & "-" & d & "-" & y regards FSt1 "Veronica" wrote: Good morning. I have been trying to put a macro in place that will rename Sheet 1 tab to the current date, every day, in many different new workbooks created daily. I know the function =TODAY() however I can't seem to get that function to take on the tab itself. I see that you can Insert an Excel Macro on the tab, but I don't know how to create this either. I can get the Tab to read Macro1 - but then I don't know how to write that Macro. I appreciate any input! -- Thanks! Veronica. |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Insert Current Date on a Sheet 1 Tab
wow!!!
-- RyGuy "FSt1" wrote: hi you can't name a sheet by a date because you can't use traditions date seperators in the name. these characters are forbidden by excel :, /, \, *,[ ,] you can name it with someting that looks like a date like' 2-12-2008 or Feb-12-2008 and that can be done with a macro. Dim td As Date Dim d As Long Dim m As String Dim y As Long td = Date d = Day(td) m = Format(Month(td), "mmm") y = Year(td) Sheets("sheet1").Name = _ m & "-" & d & "-" & y regards FSt1 "Veronica" wrote: Good morning. I have been trying to put a macro in place that will rename Sheet 1 tab to the current date, every day, in many different new workbooks created daily. I know the function =TODAY() however I can't seem to get that function to take on the tab itself. I see that you can Insert an Excel Macro on the tab, but I don't know how to create this either. I can get the Tab to read Macro1 - but then I don't know how to write that Macro. I appreciate any input! -- Thanks! Veronica. |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Insert Current Date on a Sheet 1 Tab
OK - I will give this a try.
-- Thanks! Veronica. "FSt1" wrote: hi you can't name a sheet by a date because you can't use traditions date seperators in the name. these characters are forbidden by excel :, /, \, *,[ ,] you can name it with someting that looks like a date like' 2-12-2008 or Feb-12-2008 and that can be done with a macro. Dim td As Date Dim d As Long Dim m As String Dim y As Long td = Date d = Day(td) m = Format(Month(td), "mmm") y = Year(td) Sheets("sheet1").Name = _ m & "-" & d & "-" & y regards FSt1 "Veronica" wrote: Good morning. I have been trying to put a macro in place that will rename Sheet 1 tab to the current date, every day, in many different new workbooks created daily. I know the function =TODAY() however I can't seem to get that function to take on the tab itself. I see that you can Insert an Excel Macro on the tab, but I don't know how to create this either. I can get the Tab to read Macro1 - but then I don't know how to write that Macro. I appreciate any input! -- Thanks! Veronica. |
#6
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Insert Current Date on a Sheet 1 Tab
This definitely put a date on my Sheet 1. It is giving me January 12, 2008
however. Is there a way to tell the macro to always use a current date? -- Thanks! Veronica. "FSt1" wrote: hi you can't name a sheet by a date because you can't use traditions date seperators in the name. these characters are forbidden by excel :, /, \, *,[ ,] you can name it with someting that looks like a date like' 2-12-2008 or Feb-12-2008 and that can be done with a macro. Dim td As Date Dim d As Long Dim m As String Dim y As Long td = Date d = Day(td) m = Format(Month(td), "mmm") y = Year(td) Sheets("sheet1").Name = _ m & "-" & d & "-" & y regards FSt1 "Veronica" wrote: Good morning. I have been trying to put a macro in place that will rename Sheet 1 tab to the current date, every day, in many different new workbooks created daily. I know the function =TODAY() however I can't seem to get that function to take on the tab itself. I see that you can Insert an Excel Macro on the tab, but I don't know how to create this either. I can get the Tab to read Macro1 - but then I don't know how to write that Macro. I appreciate any input! -- Thanks! Veronica. |
#7
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Insert Current Date on a Sheet 1 Tab
That did it! Can't thank you all enough for your knowledge!!
Have a great day! -- Veronica. "Herbert Seidenberg" wrote: Try Sub NameShToday() Dim td As Date Dim d As Long Dim e As Long Dim m As String Dim y As Long td = Date d = Day(td) e = Month(td) m = MonthName(e, 1) y = Year(td) Sheets("Sheet1").Name = _ m & "-" & d & "-" & y End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can Excel automatically insert current date in a cell? | Excel Worksheet Functions | |||
Insert Current Date when cell is empty?? | Excel Worksheet Functions | |||
How can I check a cell for current date and insert it if blank? | New Users to Excel | |||
Any quick key to insert current Date and Time? | Excel Discussion (Misc queries) | |||
How to insert a current date | Excel Discussion (Misc queries) |