Thank you to Harald, Bob, Ron and Dana for the solutions you supplied.
Works a treat.
Regards
Pank
"Dana DeLouis" wrote:
April to get Quarter number to 1, run macro in July to get Quarter number
to
2, ...
Just another idea. If you run your macro anytime in July, Aug, or Sep, and
still want the previous quarter, perhaps another option...
Qrtr = 499 Mod (Format(Date, "q") + 4)
HTH
--
Dana DeLouis
Win XP & Office 2003
"Pank" wrote in message
...
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?
|