Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Saveas VBA question
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 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Saveas VBA question
instead of
Month(Target.Value) try MonthName(Month(Target.Value)) pls click YES if it helped On 2 Cze, 08:36, Lost wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
SaveAs - VBA | Excel Discussion (Misc queries) | |||
SaveAs - VBA | Excel Discussion (Misc queries) | |||
VBA SaveAs Value | Excel Discussion (Misc queries) | |||
SaveAs | Excel Worksheet Functions | |||
Q: overwrite during saveas | Excel Discussion (Misc queries) |