Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Saving a time stamp with a macro?

I am converting .csv data files from a SCADA system for
historical data. Once the .csv files have been converted,
I have created and run a macro that sorts out all of the
information and averages things out with nice and neat
formatting. I would like to help my work mates out and
speed things up by adding a "save as" function withing the
macro. My question for all of you is, is there a way
possible to save a timestamp of the day so that you don't
have to manually type in the date and change the name
after the macro has already saved it as a .xls file?

Anything suggestions would be greatly appreciated!!!

Ray Morton
Springfield, Oregon
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default Saving a time stamp with a macro?

Ray,

Activeworkbook.SaveAs FileName:= "myFile" & Format(NOW,"dd mmm yyy
hh:mm:ss") & ".xls"



--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"Ray Morton" wrote in message
...
I am converting .csv data files from a SCADA system for
historical data. Once the .csv files have been converted,
I have created and run a macro that sorts out all of the
information and averages things out with nice and neat
formatting. I would like to help my work mates out and
speed things up by adding a "save as" function withing the
macro. My question for all of you is, is there a way
possible to save a timestamp of the day so that you don't
have to manually type in the date and change the name
after the macro has already saved it as a .xls file?

Anything suggestions would be greatly appreciated!!!

Ray Morton
Springfield, Oregon



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Saving a time stamp with a macro?

I tried typing that into visual basic editor to edit the
macro, it gives me run time error '1004' and then it sends
me to debug to code? Am I just not entering it right?

Ray
-----Original Message-----
Ray,

Activeworkbook.SaveAs FileName:= "myFile" & Format

(NOW,"dd mmm yyy
hh:mm:ss") & ".xls"



--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"Ray Morton" wrote in message
...
I am converting .csv data files from a SCADA system for
historical data. Once the .csv files have been

converted,
I have created and run a macro that sorts out all of the
information and averages things out with nice and neat
formatting. I would like to help my work mates out and
speed things up by adding a "save as" function withing

the
macro. My question for all of you is, is there a way
possible to save a timestamp of the day so that you

don't
have to manually type in the date and change the name
after the macro has already saved it as a .xls file?

Anything suggestions would be greatly appreciated!!!

Ray Morton
Springfield, Oregon



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Tom is offline
external usenet poster
 
Posts: 44
Default Saving a time stamp with a macro?

You can't use colons for naming a file.


"Ray Morton" schrieb im Newsbeitrag
...
I tried typing that into visual basic editor to edit the
macro, it gives me run time error '1004' and then it sends
me to debug to code? Am I just not entering it right?

Ray
-----Original Message-----
Ray,

Activeworkbook.SaveAs FileName:= "myFile" & Format

(NOW,"dd mmm yyy
hh:mm:ss") & ".xls"



--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"Ray Morton" wrote in message
...
I am converting .csv data files from a SCADA system for
historical data. Once the .csv files have been

converted,
I have created and run a macro that sorts out all of the
information and averages things out with nice and neat
formatting. I would like to help my work mates out and
speed things up by adding a "save as" function withing

the
macro. My question for all of you is, is there a way
possible to save a timestamp of the day so that you

don't
have to manually type in the date and change the name
after the macro has already saved it as a .xls file?

Anything suggestions would be greatly appreciated!!!

Ray Morton
Springfield, Oregon



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default Saving a time stamp with a macro?

Ray,

No, what he means is that you can't use the format for time that I gave you
as it includes a colon, which is an illegal filename character.

Try this instead

ActiveWorkbook.SaveAs Filename:="myFile" & Format(Now, "dd mmm yyy
hh-mm-ss") & ".xls

Change myFiles to your filename (I'm sure you already knew that), and watch
the wrap-around, it's all one line.

Sorry for the confusion.

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"Ray Morton" wrote in message
...
So by looking at what Bob wrote down where do you see the
problem? if I remove the ":" from the "NOW" statement will
it work?
-----Original Message-----
You can't use colons for naming a file.


"Ray Morton" schrieb im Newsbeitrag
...
I tried typing that into visual basic editor to edit the
macro, it gives me run time error '1004' and then it

sends
me to debug to code? Am I just not entering it right?

Ray
-----Original Message-----
Ray,

Activeworkbook.SaveAs FileName:= "myFile" & Format
(NOW,"dd mmm yyy
hh:mm:ss") & ".xls"



--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the

Purbecks


"Ray Morton" wrote in message
...
I am converting .csv data files from a SCADA system

for
historical data. Once the .csv files have been
converted,
I have created and run a macro that sorts out all of

the
information and averages things out with nice and

neat
formatting. I would like to help my work mates out

and
speed things up by adding a "save as" function

withing
the
macro. My question for all of you is, is there a way
possible to save a timestamp of the day so that you
don't
have to manually type in the date and change the name
after the macro has already saved it as a .xls file?

Anything suggestions would be greatly appreciated!!!

Ray Morton
Springfield, Oregon


.



.



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 Stamp Ken Excel Discussion (Misc queries) 2 May 5th 10 01:15 PM
Time Stamp Sara Excel Worksheet Functions 1 February 5th 09 02:32 PM
time stamp Bally Excel Worksheet Functions 2 April 9th 08 07:40 PM
Macro Time stamp Help DP7 Excel Worksheet Functions 2 August 31st 07 03:28 PM
Insert Time Stamp when macro is run Nagesh Excel Discussion (Misc queries) 3 March 13th 07 06:11 AM


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

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

About Us

"It's about Microsoft Excel"