Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I want to create a new worksheet and give it the name of the date I use this code but I get error 1004 Worksheets.Add(After:=Worksheets(Worksheets.Count) ).Name = DateValue(Now) Can you please tell me what I am doing wrong. I have checked help files and the internet I cant get working Thanks for you time. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use this Antonis
Worksheets.Add(After:=Worksheets(Worksheets.Count) ).Name _ = Format(Now, "dd-mm-yy h-mm-ss") Change the format as you like -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Antonis" wrote in message ... Hello, I want to create a new worksheet and give it the name of the date I use this code but I get error 1004 Worksheets.Add(After:=Worksheets(Worksheets.Count) ).Name = DateValue(Now) Can you please tell me what I am doing wrong. I have checked help files and the internet I cant get working Thanks for you time. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this instead of DateValue(Now) :-
Format(DateValue(Now), "YYMMDD") You can alter the format to suit your needs Geoff "Antonis" wrote in message ... Hello, I want to create a new worksheet and give it the name of the date I use this code but I get error 1004 Worksheets.Add(After:=Worksheets(Worksheets.Count) ).Name = DateValue(Now) Can you please tell me what I am doing wrong. I have checked help files and the internet I cant get working Thanks for you time. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks a lot.
I also found this way if it interests you. Dim ShName As String Dim nChr As Integer ShName = CStr(Date) ' Replace / For nChr = 1 To Len(ShName) If Mid(ShName, nChr, 1) = "/" Then Mid(ShName, nChr, 1) = "-" Next Worksheets.Add(After:=Worksheets(Worksheets.Count) ).Name = ShName It is an interesting approach Thanks again |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It is an interesting approach
if you like to use more code than you need <g -- Regards, Tom Ogilvy Antonis wrote in message ... Thanks a lot. I also found this way if it interests you. Dim ShName As String Dim nChr As Integer ShName = CStr(Date) ' Replace / For nChr = 1 To Len(ShName) If Mid(ShName, nChr, 1) = "/" Then Mid(ShName, nChr, 1) = "-" Next Worksheets.Add(After:=Worksheets(Worksheets.Count) ).Name = ShName It is an interesting approach Thanks again |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
formula to look at current date and markdown date to give price | Excel Discussion (Misc queries) | |||
can anyone give me all the functions in the excel worksheet with | Excel Worksheet Functions | |||
Formula to give date and time | Excel Worksheet Functions | |||
How to give access to certain cells in the protected worksheet ? | Excel Worksheet Functions | |||
How do I give all access to one worksheet but not to other worksh. | Excel Worksheet Functions |