View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Copying text as a formula?

Hi
try changing the line
myB1.FormulaR1C1 = myFormula


to
myB1.FormulaR1C1 = myFormula.formulaR1C1

as you currently assign the VALUE to the formulaR1C1
property


-----Original Message-----
I have been able to automate composition of formulas, by

concatenation and
other methods, as text strings. '=RC[-1] is a typical

result. I am trying to
copy this resulting in a usable formula without success.

I have developed
the following:

Sub Macro1()
'('=RC[-1] is previously entered in C1.)
Dim myFormula As Range
Dim myB1 As Range
Set myFormula = Range("C1")
Set myB1 = Range("B1")
myB1.FormulaR1C1 = myFormula
End Sub

The result in B1 is =RC[-1], both in the cell and the

formula bar, but it
won't function as a formula until I manually click on the

formula bar and
peck Enter.

I know I am missing something?

Thanks in advance


.