ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save on change (https://www.excelbanter.com/excel-programming/290711-save-change.html)

Birdy

Save on change
 
Hello

I want to save a worksheet to another workbook when there is a change in a
cell on sheet 1 range(a7:c300)
If the workbook to save already exists then overwrite workbook with new
values.

Thanks Birdy



Bob Phillips[_6_]

Save on change
 
Birdy,

This code in the worksheet code module will do it (although it could get a
bit CPU heavy!)

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False
On Error GoTo ws_exit
If Not Intersect(Target, Range("A7:C300")) Is Nothing Then
ThisWorkbook.Save
End If
ws_exit:
Application.EnableEvents = True
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Birdy" wrote in message
.nl...
Hello

I want to save a worksheet to another workbook when there is a change in a
cell on sheet 1 range(a7:c300)
If the workbook to save already exists then overwrite workbook with new
values.

Thanks Birdy






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

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