Macros and Formulae

  • Thread starter Thread starter Juan
  • Start date Start date
J

Juan

Okay, I have a super simple problem that for some reason continues t
elude me. I wrote a macro that includes a command that tell the targe
cell "B246" to state the answer from another cell or "K25". And the
another macro that changes it back to "G27". So my code looks lik
this for the first step:

Range("B246").Select
ActiveCell.FormulaR1C1 = "=K25"

Now when I run it all I get is "#NAME?" in the target cell (B246). An
I made sure to format the target cell the same as the contibuting cell
What am I missing
 
FormulaR1C1 requires R1C1-style references:

Range("B246").FormulaR1C1 = "=R25C11"

For A1-style references, use

Range("B246").Formula = "=K25"

Note that you almost never need to select a range in order to use it.
 
Hi
try
Range("B246").Formula = "=K25"

you have used the R1C1 formula property but did not assign a R1C1
conform formula. Also no need for a selection prior to assigning the
formula
 
Back
Top