Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

--
Paul98
-----------------------------------------------------------------------
Paul987's Profile: http://www.excelforum.com/member.php...fo&userid=2485
View this thread: http://www.excelforum.com/showthread.php?threadid=51737

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default 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 ,
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Allowing user to choose what mathmatical operator macro uses


Thanks for the response. The named formula works well.


--
Paul987
------------------------------------------------------------------------
Paul987's Profile: http://www.excelforum.com/member.php...o&userid=24850
View this thread: http://www.excelforum.com/showthread...hreadid=517379

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
Allowing user to choose to accept saveas option Tel Excel Discussion (Misc queries) 4 June 29th 09 12:06 PM
Locking a worksheet, but allowing user to add rows in a table Ray Carter Excel Worksheet Functions 2 September 24th 08 11:51 PM
How do I protect a number of sheets allowing the user to add a com Prashanth KR New Users to Excel 8 August 28th 07 04:06 PM
Allowing user to merge cells Lavanya Excel Discussion (Misc queries) 1 November 23rd 06 05:47 AM
allowing user to format a protected cell Andrew[_44_] Excel Programming 1 May 28th 04 06:56 AM


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