I'm repeating my earlier post with a different subject to see if it sparks more responses...if you're reading this, perhaps it did!
I'm sure I'm just missing something simple, but I can't seem to have VBA insert a formula to reference another cell correctly. I want to be able to have VBA put into the active cell a formula such as "=C5" so that the active cell then always references the contents of C5.
I tried:
ActiveCell.FormulaR1C1 = Range("b1").Address
But this only puts the text "$B$1" into the active cell. I then tried:
ActiveCell.FormulaR1C1 = "=" & Range("b1").Address
But this gave an "application-defined or object-defined error. I tried:
ActiveCell.FormulaR1C1 = "=" & Range("b1")
But this only put the text "=9" into the active cell (where the contents of B1 was 9), not the actual cell rerence to cell B1.
I know I'm close and missing something simple...any suggestions? Thanks!
I'm sure I'm just missing something simple, but I can't seem to have VBA insert a formula to reference another cell correctly. I want to be able to have VBA put into the active cell a formula such as "=C5" so that the active cell then always references the contents of C5.
I tried:
ActiveCell.FormulaR1C1 = Range("b1").Address
But this only puts the text "$B$1" into the active cell. I then tried:
ActiveCell.FormulaR1C1 = "=" & Range("b1").Address
But this gave an "application-defined or object-defined error. I tried:
ActiveCell.FormulaR1C1 = "=" & Range("b1")
But this only put the text "=9" into the active cell (where the contents of B1 was 9), not the actual cell rerence to cell B1.
I know I'm close and missing something simple...any suggestions? Thanks!