Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy formula result (text) only - without copying formula Mulberry Excel Discussion (Misc queries) 2 October 2nd 08 09:51 AM
Using a function/formula for copying text McKenna Excel Worksheet Functions 7 August 5th 08 02:30 AM
copying the Hyperlink function result without copying the actual formula mcheng Excel Worksheet Functions 2 June 9th 07 02:43 AM
Copying Formula Text jpx Excel Discussion (Misc queries) 2 June 8th 05 01:47 PM
Text not copying as text from Word to Excel 2003 Christine Excel Discussion (Misc queries) 4 March 3rd 05 11:33 PM


All times are GMT +1. The time now is 09:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"