Excel – VBA code – Cell change

Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range

‘ The variable KeyCells contains the cells that will
‘ cause an alert when they are changed.
Set KeyCells = Range(“h5:h50”)

If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then

‘ Display a message when one of the designated cells has been
‘ changed.
‘ Place your code here.
‘ MsgBox (“Cell ” & Target.Address & ” has changed.”)
‘ MsgBox (“Cell ” & Target.Column & ” has changed.”)
‘ Target.Address
Cells(Target.Row, Target.Column – 1).Value = Date

End If
End Sub

Microsoft Office – Excel – *.xla

Depending on version of Windows and Office:

windows xp:

c:\Program Files\Microsoft Office\Office12\Library\

C:\Documents and Settings\nazwa_użytkownika\Dane aplikacji\Microsoft\Dodatki\

windows 7 :

c:\Program Files\Microsoft Office 15\root\office15\Library\



c:\Program Files (x86)\Microsoft Office\Office12\Library\