#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 55
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 896
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SaveAs - VBA Jae[_3_] Excel Discussion (Misc queries) 4 April 10th 08 08:10 PM
SaveAs - VBA Jae Excel Discussion (Misc queries) 0 April 10th 08 06:04 AM
VBA SaveAs Value charlie Excel Discussion (Misc queries) 4 August 27th 07 11:33 PM
SaveAs Stan Halls Excel Worksheet Functions 5 November 28th 06 07:51 PM
Q: overwrite during saveas JIM.H. Excel Discussion (Misc queries) 1 January 5th 05 07:27 PM


All times are GMT +1. The time now is 08:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"