Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Ant
 
Posts: n/a
Default Saving a monthly report using Visual Basic

Every month I save a hardcopy version of a report into a folder. I want to
run a macro to do this which amongst other things, names it after the
respective month. ie in Jan the macro saves the hardcopy report as
Report_Jan.xls. In February I want the macro to save it as Report_Feb.xls.
etc.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Chip Pearson
 
Posts: n/a
Default Saving a monthly report using Visual Basic

Try something like

ActiveWorkbook.SaveAs Filename:="Report_" & Format(Now,"MMM") &
".xls"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Ant" wrote in message
...
Every month I save a hardcopy version of a report into a
folder. I want to
run a macro to do this which amongst other things, names it
after the
respective month. ie in Jan the macro saves the hardcopy report
as
Report_Jan.xls. In February I want the macro to save it as
Report_Feb.xls.
etc.



  #3   Report Post  
Posted to microsoft.public.excel.misc
Ant
 
Posts: n/a
Default Saving a monthly report using Visual Basic

So...would that save it as FEB if it is actually February? And if I save it
today for example it would save it as MAR? If so, I really need it to save to
a month that I can manually select, for example, I need to save it as FEB
today, not MAR (It's a month end report you see, so will always be a month
behind the actual month). Can I point the name of the month to a cell that
has data validation?

"Chip Pearson" wrote:

Try something like

ActiveWorkbook.SaveAs Filename:="Report_" & Format(Now,"MMM") &
".xls"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Ant" wrote in message
...
Every month I save a hardcopy version of a report into a
folder. I want to
run a macro to do this which amongst other things, names it
after the
respective month. ie in Jan the macro saves the hardcopy report
as
Report_Jan.xls. In February I want the macro to save it as
Report_Feb.xls.
etc.




  #4   Report Post  
Posted to microsoft.public.excel.misc
David
 
Posts: n/a
Default Saving a monthly report using Visual Basic

?B?QW50?= wrote

So...would that save it as FEB if it is actually February? And if I
save it today for example it would save it as MAR? If so, I really
need it to save to a month that I can manually select, for example, I
need to save it as FEB today, not MAR (It's a month end report you
see, so will always be a month behind the actual month). Can I point
the name of the month to a cell that has data validation?


If you have a date that reflects that month somewhere in the report you can
include part of that cell's value in the filename. i.e.:

ActiveWorkbook.SaveAs Filename:="Report_" & Format(Range("g2"), "mmm") &
".xls"

--
David
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
I don't want to run visual basic editer code after saving... areddy Excel Discussion (Misc queries) 1 October 26th 05 01:57 PM
Linking to Visual Basic for Applications Help Files Glynn Excel Discussion (Misc queries) 0 October 8th 05 01:29 AM
changing the visual basic in office 2003 to visual studio net bigdaddy3 Excel Discussion (Misc queries) 1 September 13th 05 10:57 AM
Macro Calling Visual Basic References phauenstein Excel Discussion (Misc queries) 1 August 24th 05 09:28 PM
Visual Basic Code Remains in "memory" Paul Moles Excel Worksheet Functions 1 December 10th 04 10:29 PM


All times are GMT +1. The time now is 10:21 AM.

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"