Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Date/time Stamp?


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default Date/time Stamp?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Date/time Stamp?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default Date/time Stamp?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Date/time Stamp?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Date/time Stamp?


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Date/time Stamp?


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Date/time Stamp?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Time date stamp naslami Excel Worksheet Functions 0 October 6th 09 03:11 AM
Date-Time Stamp [email protected] Excel Discussion (Misc queries) 1 September 27th 06 02:37 PM
date/time stamp Jan Excel Worksheet Functions 7 July 14th 05 01:04 PM
Date time stamp Frank Kabel Excel Programming 3 March 1st 04 08:56 PM
Date time stamp Chip Pearson Excel Programming 0 March 1st 04 04:14 PM


All times are GMT +1. The time now is 09:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"