Excel VBA: Determine the address of the changed cell

This is something that I just figured out today (I'm just beginning to learn VBA) and I thought that it might be useful to others.

If you need to find out the address of the last changed cell in Excel, the following code might be of help.

This code has to be added to the active worksheet in the Visual Basic Editor (Alt+F11)

Private Sub Worksheet_Change(ByVal Target As Range)
MsgBox("The cell that was last changed was " & Target.Address)
End Sub

0 Responses to "Excel VBA: Determine the address of the changed cell"

Post a Comment