PC Review


Reply
Thread Tools Rate Thread

Convert string to expression

 
 
WC Justice
Guest
Posts: n/a
 
      9th Jun 2005
I have a small vba subroutine that uses an inputbox to collect a fraction,
such as "12.34/56.78", parses the string into numerator and denominator, and
puts the results in a text box--great. I would like to expand its use so
that I can input a compound expression, such as "(12.3*45.6)/78.9", and have
vba recognize it as an expression, rather than a string that needs to be
parsed. Is this possible?

Thanks


 
Reply With Quote
 
 
 
 
=?Utf-8?B?T2Zlcg==?=
Guest
Posts: n/a
 
      9th Jun 2005
I think what you are looking for is the eval function
aaa="(12.3*45.6)/78.9"
eval(aaa)

"WC Justice" wrote:

> I have a small vba subroutine that uses an inputbox to collect a fraction,
> such as "12.34/56.78", parses the string into numerator and denominator, and
> puts the results in a text box--great. I would like to expand its use so
> that I can input a compound expression, such as "(12.3*45.6)/78.9", and have
> vba recognize it as an expression, rather than a string that needs to be
> parsed. Is this possible?
>
> Thanks
>
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert string to mathematical expression Nateysz Microsoft Excel Discussion 3 11th Sep 2010 01:01 AM
Convert 'System.Collections.ObjectModel.ReadOnlyCollection(Of String)' to '1-dimensional array of String'. roidy Microsoft VB .NET 12 17th Jul 2009 10:53 AM
Expression Builder: Convert STRING to INTEGER for Calculation??? =?Utf-8?B?Y3By?= Microsoft Access 2 17th Jun 2005 05:14 AM
Anyone have a regex expression to create a numeric-only string from a formatted string? Ray Stevens Microsoft C# .NET 2 16th Mar 2005 07:15 AM
DataColumn.Expression Convert String to Integer ronniek Microsoft ADO .NET 1 11th Sep 2003 10:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:16 AM.