ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Run macro when cell contents change (https://www.excelbanter.com/excel-programming/278153-re-run-macro-when-cell-contents-change.html)

Bob Phillips[_5_]

Run macro when cell contents change
 
Sorry, should be

On Error GoTo ws_exit

of course

Bob

"Bob Phillips" wrote in message news:...
Tim,

Worksheet event code

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False
On errot GoTo ws_exit
If Not Intersect(Target, Range("A1")) Is Nothing Then
'your code here
End If

ws_exit:
Application.EnableEvents = True
End Sub


Right-click on the sheet tab name, select the View Code option, and put

the
code in there.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks

"Tim Smith" wrote in message
...
How can I get a macro to run automatically only when a
specific cell e.g. A1 has its value changed?
Many thanks.







All times are GMT +1. The time now is 03:59 AM.

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