Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On 3 Oct, 21:49, FSt1 wrote:
On Oct 3, 3:35*pm, Johnnyboy5 wrote: 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 hi use the ampersand concatenater. you can concatenate as many cells as you want. Sub myname() Dim mn As String mn = Range("A2").Value & Range("B2").Value MsgBox mn End Sub regards FSt1 Sorted - thanks VM. Johnnyboy |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Make (save) a file by using macro recorder. | Excel Programming | |||
Make a file save and close itself based on the value of a cell | Excel Programming | |||
How do I make cell references return to normal? | Excel Discussion (Misc queries) | |||
how to save /make excel file as read only? | Excel Programming | |||
How can I make File-Save , File-SaveAs Menu disabled? | Excel Programming |