View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default changing the date separator

You can use a string variable to hold a nicely formatted data:

dim myDateStr as string
mydatestr = format(date,"mm-dd-yyyy")

or whatever mdy, dmy, ydm, ... format you want.

Johnny Mick wrote:

I have to save a file using 'todays' date in the filename. I had to change
my system settings in order for the macro to work on my desktop. Runs
properly. I am being moved into a different position, and now someone else
is going to be having to run this macro. Is there a way to programmatically
change the date format (so that it uses a ' - ' separator, instead of the ' /
' default)? It would be nice to not have to change everyone's system
settings, just so they can run my macro. Oh yeah, beginner/novice excel
macro writer, so this is probably an easy one to answer. Thanks in advance
for any assistance.


--

Dave Peterson