Saveas VBA question

L

Lost

OK this code saves the file as the date which is entered into cell B2. Then
places the file in a folder that matches the months number (January = 1,
Febuary = 2,.... December = 12). The folders have to be named with numbers
tho for this to work. How could I tweak this to match January 1 2009 to the
folder named January?

Private Sub Worksheet_Change(ByVal Target As Range)
Dim MyPath As String
If Target.Address(False, False) = "B2" Then
MyPath = "F:\RS_MS Training\RS Stuffing\3rd Stuff\Penless\TQC\Filled out
Monthly TQC\" & Month(Target.Value) & "\"
ThisWorkbook.SaveAs Filename:=MyPath & Format(Target.Value,
"mmmm-dd-yy") & ".xls"
End If
End Sub
 
J

Jarek Kujawa

instead of

Month(Target.Value)

try

MonthName(Month(Target.Value))

pls click YES if it helped
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top