I'm trying to use IF function in an excel sheet to run a Macro. Can this be done? I've been told its not possible.
I'm trying to use IF function in an excel sheet to run a Macro. Can this be done? I've been told its not possible.
In life, small things bother you more than the big ones. You can sit on a mountain but not on a pin!
It's possible to run a macro dependant on a cell value using the worksheet event.
Regards,
Simon
Please read this before cross posting!
In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
If I have seen further it is by standing on the shoulders of giants.
Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)
Its my belief that a function returns a value and not an instruction. Are you sure you are not confusing the difference between an If Function and an If Statement?
Remember To Do the Following....
Use [Code].... [/Code] tags when posting code to the thread.
Mark your thread as Solved if satisfied by using the Thread Tools options.
If posting the same issue to another forum please show the link
It is possible to call a macro from the UDF is triggered, but that macro cannot change any data on the sheet directly, just as the UDF cannot.
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
I assumed, because the OP metioned "IF function in an excel sheet" that he meant a worksheet function rather than meaning VBAOriginally Posted by Aussiebear
Regards,
Simon
Please read this before cross posting!
In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
If I have seen further it is by standing on the shoulders of giants.
Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)
Originally Posted by xld
Regards, Zack Barresse
Check out the KB! :|: BOARD TAGS: WHAT ARE THEY AND HOW DO I USE THEM
What is a Microsoft MVP? | Free Microsoft Courses | My Book on Excel Tables
Thanks for the replies.
It didn't work with any formula. so we used VBA to solve the prob. i'll post the code tomorrow.
we used the call option. which worked like a trigger.
In life, small things bother you more than the big ones. You can sit on a mountain but not on a pin!