Macro Question

  • Thread starter Thread starter Matthew
  • Start date Start date
M

Matthew

How do I make a macro that will save the current workbook in another folder
with today's date as the name of the file?

Matthew
 
Matthew,

Try something like

ActiveWorkbook.SaveAs "C:\PathName\" & Format(Now,"mmddyyyy") & _
".xls"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
Awesome!!

In case I do this a few times a day, can we throw in hours and minutes?

Or, instead of asking me if I want to overwrite the second time, can it give
me a chance to rename it?

Matthew
 
Matthew,

For hours and minutes, use

ActiveWorkbook.SaveAs "C:\PathName\" & Format(Now,"mmddyyyyhhmm")
& _
".xls"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
One last question. Can I make a shortcut on my desktop to run this macro?

Or, can I set the macro to run when I open that workbook?

Matthew
 
Matthew,

If you name the macro Auto_Open, it will execute when the workbook
is opened.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
That's great. Thanks for your help!

Matthew


Chip Pearson said:
Matthew,

If you name the macro Auto_Open, it will execute when the workbook
is opened.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
I thought I was done with questions. However, they just keep on coming.

I digitally signed my macro, but I still get the message wanting to disable
or enable macros. Can I bypass this message box for this file only?

Also, when I connect to my web site to open an Excel file from it, I get a
"connect to www.osbornewood.com" box with my user name and password. Can I
tell this to always say OK?

Matthew
 
Back
Top