+ Reply to Thread
Results 1 to 8 of 8

VBA - Math Operators

  1. #1
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    161

    VBA - Math Operators

    Hi everyone,

    I've got some code that runs through a column and checks to see if the number is < than the other one..

    My problem is the fact that sometimes the criteria isnt always less than is there a way i can change the operator to a cell (value?) (I.e could be > or <)

    Please Login or Register  to view this content.
    Many thanks in advance!
    Attached Files Attached Files
    Last edited by jsneak; 11-04-2019 at 04:07 PM.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow

    Hi !

    Yes using Evaluate method …

  3. #3
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    161

    Re: VBA - Math Operators

    Thanks for the reply Marc, i've never used evaluate code in VBA - would it be difficult to adapt the above to make it fit?

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow


    Easy if only all the necessary is well explained; see also the yellow banner at the top of this page …

  5. #5
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    161

    Re: VBA - Math Operators

    Yeah just putting an example together now

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,615

    Re: VBA - Math Operators

    Please Login or Register  to view this content.
    COMPARE is some cell with < or >
    Ben Van Johnson

  7. #7
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    161

    Re: VBA - Math Operators

    File should now be attached.. Just click Go to week button, this will store the variable

    I've put some fake data in, i've put the operator in col F and i've added some fake data in Col I (Actuals)

    **Code is situated in the userform**

    Thanks for your help!

    Hi ProtonLeah,

    Thank you for your response, do you know how i would go about it begin between a range?

    Thanks!!
    Last edited by jsneak; 11-04-2019 at 04:07 PM.

  8. #8
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow

    When I click on the button that raises an error !

    A general sample like the math operator in cell F1, 2 numbers to compare in cells E3 & G3 and result via a message box :

    MsgBox Evaluate([E3].Text & [F1].Text & [G3].Text)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. math operators ><=
    By cdmurph in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-17-2006, 09:30 AM
  2. what exactly are relational operators in Excel? All math symbol?
    By Biff in forum Excel Formulas & Functions
    Replies: 35
    Last Post: 09-06-2005, 05:05 PM
  3. [SOLVED] what exactly are relational operators in Excel? All math symbol?
    By JC in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 04:05 PM
  4. what exactly are relational operators in Excel? All math symbol?
    By Biff in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 09-06-2005, 09:05 AM
  5. what exactly are relational operators in Excel? All math symbol?
    By JC in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 07:05 AM
  6. what exactly are relational operators in Excel? All math symbol?
    By Biff in forum Excel Formulas & Functions
    Replies: 24
    Last Post: 09-06-2005, 05:05 AM
  7. what exactly are relational operators in Excel? All math symbol?
    By JC in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  8. what exactly are relational operators in Excel? All math symbol?
    By JC in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM

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