![]() |
![]() |
|
|||||||
| 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 |
|
New Member
Join Date: May 2002
Posts: 10
|
In using the SaveAs Filename function in VBA, I want to have the spreadsheet dynamically assign the filename by getting the contents of two cells in the workbook and concatenating them together. Basically, the spreadsheet with the values of cell A1 (JanesSpreadsheet) and cell B2 (May2002) would save as Filename = "JanesSpreadsheetMay2002". I can't seem to find any code examples that don't explicitly name the file. Can anyone help?
|
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
Quote:
=("a1").value & ("B2")value |
|
|
|
|
|
|
#3 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Newcastle, UK
Posts: 1,174
|
Quote:
ThisWorkbook.SaveAs "C:" & Sheet1.Range("A1").Value & Sheet1.Range("B2").Value where is only ment to be 1 backslash _________________ Share the wealth!! Ian Mac [ This Message was edited by: Ian Mac on 2002-05-23 16:11 ] |
|
|
|
|
|
|
#4 |
|
New Member
Join Date: May 2002
Posts: 10
|
Thank you for the assistance, it works!
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|