+ Reply to Thread
Results 1 to 10 of 10

converting a string having a comparison operator into boolean

  1. #1
    Registered User
    Join Date
    04-06-2016
    Location
    kolkata
    MS-Off Ver
    2010
    Posts
    12

    converting a string having a comparison operator into boolean

    Hello,

    in vb 6 can I get a Boolean value like true or false from a string which contains (a-b) where a and both are numbers.

    Please help

    thanks in advance

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: converting a string having a comparison operator into boolean

    Welcome to the board.

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    04-06-2016
    Location
    kolkata
    MS-Off Ver
    2010
    Posts
    12

    Re: converting a string having a comparison operator into boolean

    First of all,thank you for the reply,

    However my problem was

    dim str as string

    dim a as integer

    dim b as integer

    a=15

    b=10

    str="a-b"

    Now I want the str to be Boolean value like true or false like if i can cbool(str) the true value returns

    thanks for the welcome

    Sourav

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: converting a string having a comparison operator into boolean

    Are you thinking of something like


    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  5. #5
    Registered User
    Join Date
    04-06-2016
    Location
    kolkata
    MS-Off Ver
    2010
    Posts
    12

    Re: converting a string having a comparison operator into boolean

    Thanks very much for taking your invaluable time to help me,I think here str is being pattern matched with some digits,but my problem is str="a>b",and that I need to be evaluated as a Boolean like true or false,I don't know whether this is possible or not but trying cbool is not working

    Thanks

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: converting a string having a comparison operator into boolean

    The board isn't cooperating. See attached.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    04-06-2016
    Location
    kolkata
    MS-Off Ver
    2010
    Posts
    12

    Re: converting a string having a comparison operator into boolean

    Oh my god,you just solved it,thank you so so so very much,

    may god bless you,

    I am a very clumsy programmer with no formal training

    I tried to replace sumifs with code that may seem disgustingly bad,without the less than or greater than ability,I like to incorporate those now

    here without the special abilities like greater than or less than,all you have to do is select a range from your worksheet ,the selection should have columns like sum range criteria range
    Last edited by allsourav; 04-06-2016 at 09:39 PM.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: converting a string having a comparison operator into boolean

    Please take a few minutes to read the forum rules, and then edit your post to add CODE tags.

    Thanks.

  9. #9
    Registered User
    Join Date
    04-06-2016
    Location
    kolkata
    MS-Off Ver
    2010
    Posts
    12

    Re: converting a string having a comparison operator into boolean

    Oh really sorry,I have deleted it

    Thank you

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: converting a string having a comparison operator into boolean

    You're welcome.

+ 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. Boolean operator within excel function
    By ncd99 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-11-2015, 02:04 PM
  2. [SOLVED] Display column result converting boolean to string (number to text)
    By heyvoon in forum Excel General
    Replies: 3
    Last Post: 10-21-2014, 06:24 AM
  3. [SOLVED] Comparison operator > not working
    By mottoth in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-01-2014, 09:23 AM
  4. Replies: 0
    Last Post: 04-13-2013, 06:07 AM
  5. [SOLVED] Logical Formula with comparison operator not behaving as expected
    By attal in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-26-2013, 02:13 PM
  6. [SOLVED] need formula for comparison operator
    By Mindoz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2012, 04:42 PM
  7. Boolean comparison: range vs. single cell
    By msimms in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-11-2006, 08:55 PM

Tags for this Thread

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