ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How can I automate the saving of a worksheet? (https://www.excelbanter.com/excel-discussion-misc-queries/44347-how-can-i-automate-saving-worksheet.html)

maacmaac

How can I automate the saving of a worksheet?
 

I want to automate an excel spreadsheet with a Macro. The macro I
currently have in the sheet is asking the user if he/she wants to save
the worksheet. If user indicates yes, I want to save the sheet but
only using the information that is in cell A1 (the information in this
cell is different everytime the user opens the document)

Thanks in advance for any comments!!!


--
maacmaac
------------------------------------------------------------------------
maacmaac's Profile: http://www.excelforum.com/member.php...fo&userid=2959
View this thread: http://www.excelforum.com/showthread...hreadid=465783


Dave Peterson

I would think your macro would contain something like:


with activeworkbook
.SaveAs Filename:="c:\yourpath\" _
& .worksheets("sheet1").range("a1").value, _
fileformat:=xlWorkbookNormal
end with

But it would depend on what's in A1, too.

But remember that there are characters that are not allowed in a filename
(slashes come to mind).

maacmaac wrote:

I want to automate an excel spreadsheet with a Macro. The macro I
currently have in the sheet is asking the user if he/she wants to save
the worksheet. If user indicates yes, I want to save the sheet but
only using the information that is in cell A1 (the information in this
cell is different everytime the user opens the document)

Thanks in advance for any comments!!!

--
maacmaac
------------------------------------------------------------------------
maacmaac's Profile: http://www.excelforum.com/member.php...fo&userid=2959
View this thread: http://www.excelforum.com/showthread...hreadid=465783


--

Dave Peterson


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

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