Change another cell's contents from current cell???

G

Guest

One of the basics of Excel is that I can define a cell's contents by creating
a formula in that cell that links to another cell. For example, I can enter
the formula =A5 into cell A1 and A1 would then be equal to whatever is in A5.

This works great. However, I would like to do the opposite. I would like to
define another cell's contents by creating a formula in the current cell.
For example, I would set cell A5 equal to say "nnn" by entering a formula
into cell A1. That is, cell A1 would modify an external cell A5.

Is this possible using Excel's basic formulas or would I have to use VBA?
Moreover, can I automatically run a VBA macro from a cell, in pretty much the
same way that say the formula =SUM() automatically runs?

I would appreciate any advice. Thanks.
 
F

Fred Smith

No, one cell cannot change another cell's contents without VBA.

To change A5 based on what's in A1, you need to enter the formula in A1.
Something like:

=if(a1="test","nnn","not nnn")

You cannot get a cell to run a macro. However, you can create your own
functions. So instead of using =Sum(...), you can say =Mysum(...), and then
create the function Mysum in VBA.
 

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