+ Reply to Thread
Results 1 to 3 of 3

Allowing user to choose what mathmatical operator macro uses

  1. #1
    Forum Contributor
    Join Date
    07-01-2005
    Posts
    103

    Allowing user to choose what mathmatical operator macro uses

    I want a simple marco to compare two cells, but the user to decide =, <, or >. What is the best way to do this?

  2. #2
    Tushar Mehta
    Guest

    Re: Allowing user to choose what mathmatical operator macro uses

    No need for VBA. Use a named formula.

    Suppose your first (Left Hand Side) token is in A1, the operator of interest
    in B1 and the 2nd (Right Hand Side) token in C1. Then, create a named
    formula, named say Eval, with Insert | Name > Define...

    Eval =EVALUATE(Sheet1!$A$1&Sheet1!$B$1&Sheet1!$C$1)

    In D1 enter =Eval

    Change the values in A1:C1 and Eval will display the appropriate result.

    --
    Regards,

    Tushar Mehta
    www.tushar-mehta.com
    Excel, PowerPoint, and VBA add-ins, tutorials
    Custom MS Office productivity solutions

    In article <[email protected]>,
    [email protected] says...
    >
    > I want a simple marco to compare two cells, but the user to decide =, <,
    > or >. What is the best way to do this?
    >
    >
    > --
    > Paul987
    > ------------------------------------------------------------------------
    > Paul987's Profile: http://www.excelforum.com/member.php...o&userid=24850
    > View this thread: http://www.excelforum.com/showthread...hreadid=517379
    >
    >


  3. #3
    Forum Contributor
    Join Date
    07-01-2005
    Posts
    103
    Thanks for the response. The named formula works well.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1