LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Pank
 
Posts: n/a
Default Formula for current month minus one = Quarter number in a macro.

I have a macro that does several things. The last step should be to save the
file to a network drive with a name and quarter number appended to it.

The file save command I have got is: -

ActiveWorkbook.SaveAs Filename:= _
"Y:\Skip Register\Quarterly Charging Period ?", FileFormat:=xlExcel9795, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False,
CreateBackup:=False

The ? in the file name should be substituted by the formula as described
below.

The macro is to be run in the month following a quarter (i.e. run macro in
April to get Quarter number to 1, run macro in July to get Quarter number to
2, run macro in October to get Quarter number to 3, run macro in January to
get Quarter number to 4).

How can enter effectively enter a formula in a macro which is along the
lines of ((current month €“ 1)/3)). If current month €“ 1 = 0 then set current
month to 12 and undertake the calculation again.

Any help offer is most appreciated.

Thank You

Pank

Lastly, if my version of Excel is 2000, should I substitute 2000 in place of
9795 in the file format above?

 
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
Date formula Mike R Excel Discussion (Misc queries) 7 January 20th 05 10:07 PM
formula to have each new invoice automatically have the next numb Jacqui Excel Discussion (Misc queries) 1 January 15th 05 07:12 PM
what formula do i put for column m = column k minus column l in e. jenniss Excel Discussion (Misc queries) 5 January 6th 05 08:18 PM
Help with macro formula and variable Huge project Excel Worksheet Functions 0 December 28th 04 01:27 AM
Formula to convert to month Mel Excel Worksheet Functions 2 December 1st 04 11:52 PM


All times are GMT +1. The time now is 02:56 PM.

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"