ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add complicated cell formula within a macro (https://www.excelbanter.com/excel-programming/394438-add-complicated-cell-formula-within-macro.html)

Eric_G

Add complicated cell formula within a macro
 
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"?


FSt1

Add complicated cell formula within a macro
 
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

"Eric_G" wrote:

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"?



All times are GMT +1. The time now is 11:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com