ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Auto "Save As" Cell value when data entered in cell (https://www.excelbanter.com/excel-programming/364145-auto-save-cell-value-when-data-entered-cell.html)

Ron

Auto "Save As" Cell value when data entered in cell
 
I am developing a form template for our company. I would like it to
automatically prompt to "Save As" as soon as data in entered into the contact
cell. I would also like it to suggest for the file name, the name that is in
that cell.

I would assume this would be performed in the Visual Basic Editor but I am
not sure. Also, I am not familiar with this programming format.

Thank your for your assistance

Tom Ogilvy

Auto "Save As" Cell value when data entered in cell
 
You would use the change event and put in an if statement. Assume D1 is the
"contact cell".

Private Sub Worksheet_Change(ByVal Target As Range)
if Target.Address = "$D$1" then
if Thisworkbook.Path = "" then
ThisWorkbook.SaveAs "C:\Myfolder\" & Target.Value & ".xls"
end if
End if
End Sub

right click on the sheet tab of the sheet with the "Contact Cell" and select
view code, then put in code like the above.

http://www.cpearson.com/excel/events.htm for an overview of events.

To learn about vBA
http://msdn.microsoft.com/office/und...d/default.aspx
http://www.mvps.org/dmcritchie/excel/getstarted.htm
http://www.mvps.org/dmcritchie/excel....htm#tutorials

--
Regards,
Tom Ogilvy


"Ron" wrote:

I am developing a form template for our company. I would like it to
automatically prompt to "Save As" as soon as data in entered into the contact
cell. I would also like it to suggest for the file name, the name that is in
that cell.

I would assume this would be performed in the Visual Basic Editor but I am
not sure. Also, I am not familiar with this programming format.

Thank your for your assistance



All times are GMT +1. The time now is 09:40 AM.

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