Hello, I am writing a visual basic macro for excel. I would like the maro to run whenever the user changes the value in a particular cell of the excel spreadsheet.
Right click on the sheet tab of the sheet containg the cell, select View Code and enter the following :
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, [A1]) Is Nothing Then
'Insert code or call to procedure here
End If
End Sub
replacing A1 with the address of the cell you are interested in and insert either the code you want to run or a call to some procedure you want to activate when that cell changes.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.