ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Insert Current Date on a Sheet 1 Tab (https://www.excelbanter.com/excel-worksheet-functions/176453-insert-current-date-sheet-1-tab.html)

Veronica

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.

ryguy7272

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.


FSt1

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.


ryguy7272

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.


Veronica

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.


Veronica

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.


Veronica

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




All times are GMT +1. The time now is 06:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com