LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default use function to change a string to function's parameter

On Tue, 20 Nov 2007 23:27:01 -0800, ViestaWu wrote:

Dear all,

If A1 is "1+1", I want to get the result in B1, how to do?

I have try B1=A1, doesn't work. B1="="&A1, doesn't work. B1="="&A1 +0, reply
value error.

I need your suggestion.
Thanks!


You will need to use VBA to write a simple UDF (user defined function) to do
this.

To enter the function, <alt-F11 opens the VB Editor.
Ensure your project is highlighted in the Project Explorer window, then
Insert/Module and paste the code below into the window that opens.

To use this, enter the formula

B1: =Eval(A1)

==================================
Function Eval(str As String)
Eval = Evaluate(str)
End Function
=========================
--ron
 
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
How to choose if I use a parameter or not in a parameter query Arnaud Excel Discussion (Misc queries) 0 March 8th 07 01:19 PM
Cells display function's text rather than its results tonerowlabs Excel Discussion (Misc queries) 4 July 8th 06 12:47 PM
A correct IF function doesn't show the function's result in cell Michael Excel Discussion (Misc queries) 1 April 10th 06 09:10 AM
Cell contents as the 'lookup value' parameter in HLOOKUP function EMarre Excel Discussion (Misc queries) 3 August 30th 05 03:49 PM
Unknown IF function parameter on amortization schedule Michael from Austin Excel Worksheet Functions 1 November 9th 04 06:32 PM


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