Easy Question

  • Thread starter Thread starter Lawson
  • Start date Start date
L

Lawson

i need a program to run only if a value is met in a
certain cell...is that what this is all about?...or
something like this anyway...-->

Private Sub Worksheet_SelectionChange(ByVal Target As
Range)

End Sub
 
Lawson,

Depends on when you want the program (macro?) to run:
on selection (Target = cell selected)
on cell change (Target = cell changed)
on calculation (no Target)
each has an event

just need
If Range(A1) = *value* then
Call MyMacro
End If

change A1 to your cell, set *value* to a varaiable, a reference, or a value.
Target can sometimes be used for Range(A1) if they are the same.
 
Back
Top