MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Can a Macro be run from a value returned to a cell?


Posted by Paul Magruder on April 18, 2001 8:43 AM

Is there code that will allow me to run a macro when a number is returned to a certian cell? Example:
I want to run a macro called "showform1" if the number returned to cell "a1" is >10 but <20......New at this...

Thanks in Advance....
Paul


Posted by Stephane Parent on April 18, 2001 11:19 AM

Hi Paul,

Try this event macro. To insert it, right click on the worksheet tab and choose "view code". Then on the left box, choose worksheet and on the right box, choose change. Paste this code betwwen the sub and end sub.


If Range("a1").Value > 10 And Range("a1").Value < 20 Then
showform1
End If

This should work...

Stephane Parent

Posted by Paul Magruder on April 18, 2001 12:10 PM

Re: Thank you very much

Thanks.... just what I needed.....