ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Saving an Excel Wookbook to a Variable? (https://www.excelbanter.com/excel-programming/416141-saving-excel-wookbook-variable.html)

RMS

Saving an Excel Wookbook to a Variable?
 
I have an Excel worksheet that I use often. I save it to a file using the
clients last and first name as the file name. Since the client's name is in
a known Cell in the worksheet, it would be nice to assign the cell a
variable name and save the workbook to that name. This would save time and
help avoid typo's.

Oddly , the highly authoritative "VBA for Dummies" is strangely silent on
this issue.

Thanks, RMS


Nigel[_2_]

Saving an Excel Wookbook to a Variable?
 
Try using this code, it opens the save dialog with the text from cell A1 as
the default name.

Sub mysave()
Dim fname
fname = Application.GetSaveAsFilename(InitialFileName:=Ran ge("A1"), _
filefilter:="Excel Files (*.xls), *.xls", _
Title:="Save Workbook")
End Sub

--

Regards,
Nigel




"RMS" wrote in message
...
I have an Excel worksheet that I use often. I save it to a file using the
clients last and first name as the file name. Since the client's name is
in a known Cell in the worksheet, it would be nice to assign the cell a
variable name and save the workbook to that name. This would save time and
help avoid typo's.

Oddly , the highly authoritative "VBA for Dummies" is strangely silent on
this issue.

Thanks, RMS




All times are GMT +1. The time now is 03:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com