Add complicated cell formula within a macro

G

Guest

I am attempting to add a complicated cell formula to a cell (within a macro)
and then copy it down across a number of rows. The formula is so complicated
that I don't wish to re-type "keystroke by keystroke" when recording the
macro. Is there a way to "copy" the formula from another worksheet in such a
way that the macro recorder interprets the information entered as a formula
and NOT as literally as a "copy cell formula from cell1 to cell 2"?
 
G

Guest

hi,
you can play a mind game with excel. put an apostrophe in front of the
equals sign. excel with then look on the formula as text and not a formula.
you can then copy the formula and paste it into your code. I use this trick a
lot when helping people out here with formulas. if i copy the formula and
paste it into the reply, the formula results are pasted and not the formula.
if i do the apostrophe thing, the formula is pasted and not the results. and
without the apostrophe.

Regards
FSt1
 

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