Last active
December 11, 2023 20:44
-
-
Save elbeicktalat/8c1c02426e8c771dd361c38b39b8e6e9 to your computer and use it in GitHub Desktop.
Excel cell change event listener
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' 1) Open the developer mode | |
' 2) On the left bar, under `Microsoft Excel Objects` tab open your sheet you want to observe changes | |
' 3) Paste the code you find below | |
Private Sub Worksheet_Change(ByVal Target As Range) | |
Dim KeyCells As Range | |
' The variable KeyCells contains the cells that will | |
' run you code when they are changed. | |
Set KeyCells = Range("A1:A3") | |
If Not Application.Intersect(KeyCells, Range(Target.Address)) _ | |
Is Nothing Then | |
' Runs whenever the KeyCells changed. | |
' Place your code here. | |
End If | |
End Sub | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment