View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
big wheelz big wheelz is offline
external usenet poster
 
Posts: 2
Default SaveAs uses current open workbook filename;

Hello:
I am looking for help on some "wildcard" type characters to use in a SaveAs
command that will default to using the file name of the workbook I am
currently wishing to save.

or, alternately

Looking for help with how to specify a complete path using the Save command.

I wish to not have to type in the name of the file, or rename it each time.
I also hope to be to add commands to include saving the .xls and .csv to an
ftp site as well. Current code below:

'
Rows("6:1000").Select
Selection.Sort Key1:=Range("C6"), Order1:=xlAscending, Key2:=Range("D6") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2 _
:=xlSortNormal
Columns("F:F").Select
Selection.NumberFormat = "mm/dd/yy;@"
Columns("B:R").Select
Selection.Columns.AutoFit
Range("A1").Select
Application.DisplayAlerts = False
ChDrive ("W")
ChDir "W:\PURCHASE\SF PRODUCTION Reports"
ActiveWorkbook.SaveAs FileFormat:= _
xlCSV, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
ActiveWorkbook.SaveAs FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
End Sub