![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi,
i made some excel sheet that i need to save often (after changes) under another name, and that name always depends on cell A1 and cell B3. So i've thought to make some vba button assigned as let us say SAVE, which will save document like ty very much |
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sunny, spring-like Hull
Posts: 3,339
|
If your cells A1 and B3 are on the first worksheet and the command button has the default name, the following will save it as a combination of those cells, with a space in the middle, into the current directory. Hope this is what you meant
Private Sub CommandButton1_Click() On Error GoTo ErrTrap ThisWorkbook.SaveAs Worksheets(1).Range("A1") & " " & Worksheets(1).Range("B3") Exit Sub ErrTrap: MsgBox "Unable to save under that filename" End Sub [ This Message was edited by: Mudface on 2002-03-04 12:14 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|