Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying text as a formula?
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Bless you Frank!
It worked!
"Frank Kabel" wrote in message ... 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 . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copy formula result (text) only - without copying formula | Excel Discussion (Misc queries) | |||
Using a function/formula for copying text | Excel Worksheet Functions | |||
copying the Hyperlink function result without copying the actual formula | Excel Worksheet Functions | |||
Copying Formula Text | Excel Discussion (Misc queries) | |||
Text not copying as text from Word to Excel 2003 | Excel Discussion (Misc queries) |