Link to home
Start Free TrialLog in
Avatar of Jimi Sherman
Jimi ShermanFlag for United States of America

asked on

How to save an Excel file with the week number in it.

I cannot find the answer to this.
Here is my code;
ActiveWorkbook.SaveAs FileName:="W:\@WIPs Updates\32-Update " & "Week " & Format(Now, "yyyy-mm-dd"), FileFormat:=xlOpenXMLWorkbook

I want the file name to be "32-Update Week 20"...I do not know how to change the format part.
Thanks
Jimi
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can also get the week with the Format function by stipulating a format of "ww"....

ActiveWorkbook.SaveAs FileName:="W:\@WIPs Updates\32-Update " & "Week " & Format(Now, "ww"), FileFormat:=xlOpenXMLWorkbook
Avatar of Jimi Sherman

ASKER

Thanks
Hey Guys thanks for the answers I gave to points to Martin due to he answered first and it works.
Wayne your answer was VERY easy...did not know it could be that simple!
Thanks to you both.
Jimi
You're welcome and I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015