Run macro based on cell value

  • Thread starter Thread starter nowfal
  • Start date Start date
N

nowfal

Hi,

I wanted to run a macro based on cell value i.e., if i put in C2
number greater than zero it should trigger the macro named 'CUSTOMER'
if it is zero it should not . I am expecting a reply as early a
possible
thanks
nowfa
 
Use this event in the sheet module to do this

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("C2"), Target) Is Nothing Then
If IsNumeric(Target.Value) And Target.Value > 0 Then
CUSTOMER
End If
End If
End Sub
 
Thanks alot Mr. Ron de bruin,
The code is perfectly correct. It works exactly what i wanted. I have
been trying for this for the last one week. Any how thanks once again.
by
nowfal
 

Ask a Question

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.

Ask a Question

Back
Top