+ Reply to Thread
Results 1 to 5 of 5

CSTR character comparison

  1. #1
    Registered User
    Join Date
    04-01-2009
    Location
    WashDC
    MS-Off Ver
    Excel 2003
    Posts
    84

    CSTR character comparison

    I can't tell why this doesn't work:

    Please Login or Register  to view this content.
    c.value is dimmed as a range but refers to one cell that contains either an index number like 405.1.3.2, or a negative index number.

    I'm trying to find the ones that start with a negative sign. I could mark them some other way if that seemed better, though logically negative works pretty well.

    Thanks a bunch for any help.
    Last edited by Leith Ross; 12-17-2014 at 01:05 PM. Reason: Added Code Tags

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: CSTR character comparison

    Would this work?

    Please Login or Register  to view this content.

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: CSTR character comparison

    Hello keithwins,

    Somewhere you were misinformed about CStr. This is a function and not an object. Only objects have properties, methods, and events.

    The purpose of this function is to convert numbers stored in memory into text. Your number is already considered text by Excel. A valid number can have only one decimal point.

    To check if the cell has a negative sign, you can do this...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: CSTR character comparison

    Did you tried..

    Please Login or Register  to view this content.
    or may be..
    left(c,1)
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  5. #5
    Registered User
    Join Date
    04-01-2009
    Location
    WashDC
    MS-Off Ver
    Excel 2003
    Posts
    84

    Re: CSTR character comparison

    Thank you to everyone! This worked, so I didn't try the other variations. Very helpful, your help really made my day go better. Thank you.

+ 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. Replies: 5
    Last Post: 06-04-2014, 10:32 AM
  2. Unable to get the Vlookup Property .... class - Issue with Character / Numeric comparison
    By vidyuthrajesh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-17-2014, 03:08 PM
  3. Prevent Scientific / Exponential Notation (in CStr) ?
    By expatCanuck in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-05-2012, 05:45 AM
  4. Conditional Formatting & Character Count Comparison Macro
    By BluTalon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-05-2008, 02:59 AM
  5. CStr Question
    By dugong in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-20-2008, 07:03 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