Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
DMB
 
Posts: n/a
Default copying the function contained within a cell to anouther cell.


I am trying to copycell information. I need to copy the function in cell
"A1" to the cell "A2" for visual verification of the function being used in
the previus cell.


cellID cell1 cell2
cell contents =x*y*z VBA SelectionChanged Event
code
current cell result a number a number
wanted cell result a number the equation( ie. '=x*y*z)
from the defined cell

Range("A2") = Range("A1") is returning the calculated value. The number!

Software currently using
Excel 2000
Excel VBA

I would like to use the VB.net 2003 but it is easier for me right now to
just use the VBA. How hard is it to use VisualBasic.net 2003 to program excel
2000 and be event driven procedure? .SelectionChanged to repost cell
information.


  #2   Report Post  
Gary's Student
 
Posts: n/a
Default

Here is a VBA function to take another function as an argument and return the
string representation of it:

Function FrmulaToText(r As Range) As String
Dim s As String
s = r.Formula
FrmulaToText = s
End Function

So put =FrmulaToText(A1) into A2. The function is nice because it will
update anytime you change the formula in A1.
--
Gary's Student


"DMB" wrote:


I am trying to copycell information. I need to copy the function in cell
"A1" to the cell "A2" for visual verification of the function being used in
the previus cell.


cellID cell1 cell2
cell contents =x*y*z VBA SelectionChanged Event
code
current cell result a number a number
wanted cell result a number the equation( ie. '=x*y*z)
from the defined cell

Range("A2") = Range("A1") is returning the calculated value. The number!

Software currently using
Excel 2000
Excel VBA

I would like to use the VB.net 2003 but it is easier for me right now to
just use the VBA. How hard is it to use VisualBasic.net 2003 to program excel
2000 and be event driven procedure? .SelectionChanged to repost cell
information.


  #3   Report Post  
Duke Carey
 
Posts: n/a
Default

Range("A2") = "'"&Range("A1") .formula

"DMB" wrote:


I am trying to copycell information. I need to copy the function in cell
"A1" to the cell "A2" for visual verification of the function being used in
the previus cell.


cellID cell1 cell2
cell contents =x*y*z VBA SelectionChanged Event
code
current cell result a number a number
wanted cell result a number the equation( ie. '=x*y*z)
from the defined cell

Range("A2") = Range("A1") is returning the calculated value. The number!

Software currently using
Excel 2000
Excel VBA

I would like to use the VB.net 2003 but it is easier for me right now to
just use the VBA. How hard is it to use VisualBasic.net 2003 to program excel
2000 and be event driven procedure? .SelectionChanged to repost cell
information.


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
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM
Function syntax to compare cell contents ES Excel Worksheet Functions 2 May 18th 05 03:53 PM
Function making cell really "empty" Arvi Laanemets Excel Worksheet Functions 2 January 31st 05 05:23 PM
copy a cell value not its function KC Mao Excel Discussion (Misc queries) 2 December 4th 04 04:30 AM


All times are GMT +1. The time now is 07:53 AM.

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"