Executing a macro from a cell

G

Guest

1. There is some way to make that excel, starting from a conditional
structure in a cell, execute automatically a macro???

Something like this:
A B
1
2 1 =if(A2=1,macro1(),macro2())
 
B

Bob Phillips

No, functions can return a value, they cannot change the format or run a
macro.

You can use event code to do it, but not a worksheet function.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
H

Harald Staff

Hi

No, impossible. This is a limitation by design. A macro could change the
cell itself, the sheet, excel, and therefore mess up the original logic and
the order of calculations.

But Excel has several "calculate" events that you might use to create a
simiular effect.

HTH. Best wishes Harald
 

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

Top