ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Specify File Name (https://www.excelbanter.com/excel-discussion-misc-queries/35342-specify-file-name.html)

tkaplan

Specify File Name
 

I am trying to write VBA to save the current workbook :
I need the file name to be:
In cell D3 I have a date entered.
I want the file name to be:
RosterBillingMonthYear

so for example if D3 is 7/5/2005 the name of the file should be
"RosterBillingJuly2005"

what would be the coding for this?

thanks in advance.


--
tkaplan
------------------------------------------------------------------------
tkaplan's Profile: http://www.excelforum.com/member.php...o&userid=22987
View this thread: http://www.excelforum.com/showthread...hreadid=387230


KL

try this:

Sub test()
With ThisWorkbook
WbPath = .Path
wbName = "\RosterBilling" & _
Format(.Sheets(1).Range("D3"), "mmmmyyyy") & ".xls"
.SaveAs WbPath & wbName
End With
End Sub

Regards,
KL


"tkaplan" wrote in
message ...

I am trying to write VBA to save the current workbook :
I need the file name to be:
In cell D3 I have a date entered.
I want the file name to be:
RosterBillingMonthYear

so for example if D3 is 7/5/2005 the name of the file should be
"RosterBillingJuly2005"

what would be the coding for this?

thanks in advance.


--
tkaplan
------------------------------------------------------------------------
tkaplan's Profile:
http://www.excelforum.com/member.php...o&userid=22987
View this thread: http://www.excelforum.com/showthread...hreadid=387230





All times are GMT +1. The time now is 11:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com