trigger module on special value in cell

  • Thread starter Thread starter jocke
  • Start date Start date
J

jocke

Hi everyone.
Is there anyone who knows if there is a way to trigger a codemodule o
a special value/change of value in a cell.
Not the worksheet updateevent.

t i a

/jock
 
Hi jocke

You can use the change event in the sheet module

See Chip Pearson his page about events
http://www.cpearson.com/excel/events.htm


Example for cell A1
If the value = 10 the macro will run

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("a1"), Target) Is Nothing Then
If Target.Value = 10 Then
yourmacro
End If
End If
End Sub

Sub yourmacro()
MsgBox "Hi"
End Sub
 
No, worksheet change does it? Why not that event?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top