LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default using two cell references to make up the save as file name

How do I use two cells to make up the file save name.

eg. A1 and D1 (what ever)

Thanks

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)


mydrive = "H:"
mydir = "Temp"
myname = Sheets("sheet1").Range("a1")
ms = mydrive & "\" & mydir & "\" & myname & Format$(Date, " dd-mm-
yyyy") & "xls"
ActiveWorkbook.SaveCopyAs Filename:=ms







' Place the current files path and filename in the titlebar:
Windows(1).Caption = ActiveWorkbook.FullName



' Place your own application name in the titlebar:
Application.Caption = "SPICE SHEET FOLDER"





Cancel = True
ActiveWorkbook.Saved = True
msg = MsgBox("The workbook has been saved as " & ms, vbInformation +
vbOKOnly, "Save As")
Application.DisplayFullScreen = False
End Sub


 
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
Make (save) a file by using macro recorder. Farhan Excel Programming 3 May 29th 10 06:02 PM
Make a file save and close itself based on the value of a cell Michael Lanier Excel Programming 4 April 5th 10 11:34 AM
How do I make cell references return to normal? Jack B Excel Discussion (Misc queries) 1 October 1st 09 07:03 AM
how to save /make excel file as read only? Rich Excel Programming 2 October 11th 06 01:21 AM
How can I make File-Save , File-SaveAs Menu disabled? Zoo Excel Programming 4 June 5th 06 06:58 AM


All times are GMT +1. The time now is 09:57 PM.

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

About Us

"It's about Microsoft Excel"