ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   afterupdate event in Excel (https://www.excelbanter.com/excel-programming/420672-afterupdate-event-excel.html)

md903

afterupdate event in Excel
 
I would like to add an AfterUpdate action to a cell to clear the contents of
a second cell. For example, if the contents of cell A1 changes, I want it to
clear the contents of cell B1. Cell A1 will be updated manually.

alf

afterupdate event in Excel
 
On 30 nov, 07:32, md903 wrote:
I would like to add an AfterUpdate action to a cell to clear the contents of
a second cell. *For example, if the contents of cell A1 changes, I want it to
clear the contents of cell B1. *Cell A1 will be updated manually.


Use WorkSheet "Change" Event, and test the adress of the target cell:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.address = "$A$1" Then
Range("B1") = ""
End If
End Sub


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

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