Copying and Pasting a Formula Using a Macro.

Ste_Moore01

Active Member
Joined
Jul 13, 2005
Messages
467
Hi guys,

I'm trying to copy a formula from one cell to another using a macro.

By copying the formula, I mean the exact formula and not just copying the cell and pasting so the formula changes for your destination cell. I've tried recording a macro and it won't allow me to do it that way.

Is there any way to do this?
 

Some videos you may like

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

RAM

Well-known Member
Joined
Oct 4, 2004
Messages
1,862
You need to anchor the cell references in the original formula, i.e. A1 will be $A$1.

The fastest way to do this is selecting the cell with the formula, mark the cell references in the Formula Bar and hit F4.

HTH

RAM
 

RAM

Well-known Member
Joined
Oct 4, 2004
Messages
1,862
You can mark the whole formula in the Formula Bar in a case like this one. In other cases when you need only one cell ref anchored, i.e. A1, not A1+A2, then you mark only A1 in the Formula Bar and hit F4. Hitting F4 more than one time gives you different anchor positions as if you want to anchor the row or the column: $A1 will anchor Column A. A$1 will anchor row 1 in Column A. $A$1 will anchor cell A1
Book12
ABCD
1312
243
354
465
576
687
798
8109
91110
101211
11
12
Sheet1



RAM
 

Watch MrExcel Video

Forum statistics

Threads
1,118,436
Messages
5,572,094
Members
412,441
Latest member
kelethymos
Top