Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Evaluating a cell

if the content of a cell is the string made up of ="=sum(d3."&"d"&"1000)" which shows up as =sum(d3.d1000) how would one actually evaluate this in another cell so it would show the sum of the column d from cell 3 to 1000. Is there no eval(c1) or equivalent...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Evaluating a cell


Phillip,

Not sure what you're asking in terms of the string, but here's some
code to sum a column.

dc

Sub sum_column()

'select the range of cells you want to sum
Range("D3:D1000").Select
'activate the cell where you want to show the answer
Range("D1001").Activate
'write the answer using references rows in relation to the output cell
ActiveCell.FormulaR1C1 = "=SUM(R[-998]C:R[-1]C)"

End Sub


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Evaluating a cell

Try this UDF

Function EvalCell(RefCell As String)
EvalCell = Evaluate(RefCell)
End Function

Usage is: =EvalCell(cellref)

Where cellref contains =SUM(D3:D1000) or simply SUM(D3:D1000) or A1 + A2

Gord Dibben XL2002

On Mon, 8 Dec 2003 16:46:04 -0800, "Phillip2001" wrote:

if the content of a cell is the string made up of ="=sum(d3."&"d"&"1000)" which shows up as =sum(d3.d1000) how would one actually evaluate this in another cell so it would show the sum of the column d from cell 3 to 1000. Is there no eval(c1) or equivalent...


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
Evaluating formula in VBA Walter Briscoe New Users to Excel 5 July 1st 09 10:33 AM
#Value! error when evaluating data in a cell range Simon Woods Excel Worksheet Functions 7 January 13th 09 10:38 PM
Evaluating a range TwoDot Excel Discussion (Misc queries) 5 March 5th 07 08:59 PM
evaluating text cell contents Dave B Excel Discussion (Misc queries) 1 January 3rd 06 10:51 PM
Help Evaluating Cell Values and Changing Colors ChrisG[_2_] Excel Programming 1 July 14th 03 08:52 PM


All times are GMT +1. The time now is 11:35 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"