You use a Worksheet_Change() event. To access this press alt+f11 to access
the VBE, right click on the worksheet concerned and select view code... In
the left drop-down in the resulting window select worksheet and in the right
one select Change. You will get a template as below. Now the rub... you
have to be able to write VBA code to do anything with it. (Obviously you
could record some and cut and paste it between the Private Sub...End Sub
lines, but eventually you will need to hand write some for sure)
Private Sub Worksheet_Change(ByVal Target As Range)
End Sub
--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England www.nickhodge.co.uk
(e-mail address removed)
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 12 And Target.Row = 16 Then
' Add your code here
MsgBox "There was a change in cell L16"
End If
End Sub
Worksheet_Change monitors all cells, you just need to tell it which one,
like this
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("L16")) Is Nothing Then
OtherMacro
End If
End Sub
This will run a macro called OtherMacro if cell L16 is changed.
Now you need to beware if the macro makes other changes to the worksheet or
else you code will be called each time it is. You can prevent this by
adding
Application.EnableEvents=False
but remember to turn them back on at any place where code can exit
(including errors) or you will be left with no events at all in Excel
--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England www.nickhodge.co.uk
(e-mail address removed)
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.