Specify File Name

T

tkaplan

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.
 
K

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
 
Top