Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Anyone know a date time stamp for a macro. I have a file that i created in an old version of excel. I currently have a macro tha opens it and does "save as" change the type to "Excel Workbook" i another folder. The reason is cause access cant read the old version. I want to add a date/time stamp to the updated file so I know it is th most up-to-date. Anyone got any ideas? Bowe -- Bowes81 ----------------------------------------------------------------------- Bowes813's Profile: http://www.excelforum.com/member.php...fo&userid=2377 View this thread: http://www.excelforum.com/showthread.php?threadid=37577 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I like to use a date string = yymmdd
Dim dt As String, wbn as string dt = Format(Year(Date), "yy") & Format(Month(Date), "mm") & Format(Day(Date), "dd") wbn = "MyWorkbook" & dt or wbn = dt & "MyWorkbook" ' this auto sorts your workbooks by date -- steveB Remove "AYN" from email to respond "Bowes813" wrote in message ... Anyone know a date time stamp for a macro. I have a file that is created in an old version of excel. I currently have a macro that opens it and does "save as" change the type to "Excel Workbook" in another folder. The reason is cause access cant read the old version. I want to add a date/time stamp to the updated file so I know it is the most up-to-date. Anyone got any ideas? Bowes -- Bowes813 ------------------------------------------------------------------------ Bowes813's Profile: http://www.excelforum.com/member.php...o&userid=23779 View this thread: http://www.excelforum.com/showthread...hreadid=375773 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Steve
No. No no no. Format(Month(Date), "mm") will always return 01 and Format(Year(Date), "yy") will return 05 until year 2193. Format(Date, "yymmdd") HTH. Best wishes Harald "STEVE BELL" skrev i melding news:5Pone.11690$3u3.4148@trnddc07... I like to use a date string = yymmdd Dim dt As String, wbn as string dt = Format(Year(Date), "yy") & Format(Month(Date), "mm") & Format(Day(Date), "dd") wbn = "MyWorkbook" & dt or wbn = dt & "MyWorkbook" ' this auto sorts your workbooks by date -- steveB Remove "AYN" from email to respond "Bowes813" wrote in message ... Anyone know a date time stamp for a macro. I have a file that is created in an old version of excel. I currently have a macro that opens it and does "save as" change the type to "Excel Workbook" in another folder. The reason is cause access cant read the old version. I want to add a date/time stamp to the updated file so I know it is the most up-to-date. Anyone got any ideas? Bowes -- Bowes813 ------------------------------------------------------------------------ Bowes813's Profile: http://www.excelforum.com/member.php...o&userid=23779 View this thread: http://www.excelforum.com/showthread...hreadid=375773 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Harald,
My bad! Started playing with it after I sent it in and couldn't figure out why it didn't work just right. Changed it to your setting and it worked... Can you help me understand why it didn't work... thanks... -- steveB Remove "AYN" from email to respond "Harald Staff" wrote in message ... Hi Steve No. No no no. Format(Month(Date), "mm") will always return 01 and Format(Year(Date), "yy") will return 05 until year 2193. Format(Date, "yymmdd") HTH. Best wishes Harald "STEVE BELL" skrev i melding news:5Pone.11690$3u3.4148@trnddc07... I like to use a date string = yymmdd Dim dt As String, wbn as string dt = Format(Year(Date), "yy") & Format(Month(Date), "mm") & Format(Day(Date), "dd") wbn = "MyWorkbook" & dt or wbn = dt & "MyWorkbook" ' this auto sorts your workbooks by date -- steveB Remove "AYN" from email to respond "Bowes813" wrote in message ... Anyone know a date time stamp for a macro. I have a file that is created in an old version of excel. I currently have a macro that opens it and does "save as" change the type to "Excel Workbook" in another folder. The reason is cause access cant read the old version. I want to add a date/time stamp to the updated file so I know it is the most up-to-date. Anyone got any ideas? Bowes -- Bowes813 ------------------------------------------------------------------------ Bowes813's Profile: http://www.excelforum.com/member.php...o&userid=23779 View this thread: http://www.excelforum.com/showthread...hreadid=375773 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
CTRL + ; is used for Date Stamp
CTRL + SHFT + : is used for Time Stamp I don't believe there is a short-cut key that does it together GH. "Bowes813" wrote: Anyone know a date time stamp for a macro. I have a file that is created in an old version of excel. I currently have a macro that opens it and does "save as" change the type to "Excel Workbook" in another folder. The reason is cause access cant read the old version. I want to add a date/time stamp to the updated file so I know it is the most up-to-date. Anyone got any ideas? Bowes -- Bowes813 ------------------------------------------------------------------------ Bowes813's Profile: http://www.excelforum.com/member.php...o&userid=23779 View this thread: http://www.excelforum.com/showthread...hreadid=375773 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, Keyboard shortcut to stamp the time and date in a cell, press Ctrl + ; then spacebar then Ctrl + Shift + ;. Thx Dave Generic Hero Wrote: CTRL + ; is used for Date Stamp CTRL + SHFT + : is used for Time Stamp I don't believe there is a short-cut key that does it together GH. "Bowes813" wrote: Anyone know a date time stamp for a macro. I have a file that is created in an old version of excel. I currently have a macro that opens it and does "save as" change the type to "Excel Workbook" in another folder. The reason is cause access cant read the old version. I want to add a date/time stamp to the updated file so I know it is the most up-to-date. Anyone got any ideas? Bowes -- Bowes813 ------------------------------------------------------------------------ Bowes813's Profile: http://www.excelforum.com/member.php...o&userid=23779 View this thread: http://www.excelforum.com/showthread...hreadid=375773 -- Piranha ------------------------------------------------------------------------ Piranha's Profile: http://www.excelforum.com/member.php...o&userid=20435 View this thread: http://www.excelforum.com/showthread...hreadid=375773 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() ok, here is the script I am using to save a copy of the xls file in a archive. I'm just starting to use VBE and macros and stuff so I reall don't know what you mean by adding strings and Dim stuff. Could yo show me how to insert the date stamp you gave me into this code: Sub Macro1() ' ' Macro1 Macro ' Macro recorded 6/2/2005 by ' ' ChDir "L:\" Workbooks.Open Filename:="L:\pipeline.xls" Workbooks.Open Filename:="L:\trades.xls" ChDir "Y:\0008 ARCHIVE\Pipeline Dated" ActiveWorkbook.SaveAs Filename:="Y:\0008 ARCHIVE\Pipelin Dated\trades.xls", _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False ActiveWindow.WindowState = xlNormal ActiveWindow.Close ActiveWorkbook.SaveAs Filename:="Y:\0008 ARCHIVE\Pipelin Dated\pipeline.xls" _ , FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False ActiveWindow.Close End Su -- Bowes81 ----------------------------------------------------------------------- Bowes813's Profile: http://www.excelforum.com/member.php...fo&userid=2377 View this thread: http://www.excelforum.com/showthread.php?threadid=37577 |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Something like
Workbooks("trades.xls").SaveCopyAs "Y:\0008 ARCHIVE\trades_" & _ Format(Date, "yymmdd_hhmm") & ".xls" HTH. Best wishes Harald "Bowes813" skrev i melding ... ok, here is the script I am using to save a copy of the xls file in an archive. I'm just starting to use VBE and macros and stuff so I really don't know what you mean by adding strings and Dim stuff. Could you show me how to insert the date stamp you gave me into this code: Sub Macro1() ' ' Macro1 Macro ' Macro recorded 6/2/2005 by ' ' ChDir "L:\" Workbooks.Open Filename:="L:\pipeline.xls" Workbooks.Open Filename:="L:\trades.xls" ChDir "Y:\0008 ARCHIVE\Pipeline Dated" ActiveWorkbook.SaveAs Filename:="Y:\0008 ARCHIVE\Pipeline Dated\trades.xls", _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False ActiveWindow.WindowState = xlNormal ActiveWindow.Close ActiveWorkbook.SaveAs Filename:="Y:\0008 ARCHIVE\Pipeline Dated\pipeline.xls" _ , FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False ActiveWindow.Close End Sub -- Bowes813 ------------------------------------------------------------------------ Bowes813's Profile: http://www.excelforum.com/member.php...o&userid=23779 View this thread: http://www.excelforum.com/showthread...hreadid=375773 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Time date stamp | Excel Worksheet Functions | |||
Date-Time Stamp | Excel Discussion (Misc queries) | |||
date/time stamp | Excel Worksheet Functions | |||
Date time stamp | Excel Programming | |||
Date time stamp | Excel Programming |