+ Reply to Thread
Results 1 to 6 of 6

Excel VBA Find Zero Value (Shows up as hyphen)

  1. #1
    Registered User
    Join Date
    04-15-2011
    Location
    Dallas,TX
    MS-Off Ver
    Excel 2010
    Posts
    21

    Excel VBA Find Zero Value (Shows up as hyphen)

    Hi Guys,

    I'm really stuck here trying to figure this out.

    I have a column of data that may or may not have a formula in them. The cells are formatted in Accounting, w/o the leading $ sign. (i.e. 133.57) The value zero shows up as a hyphen or dash.

    The issue is that when I'm trying to write a macro that highlights all values that are zero (hyphen), the find code can't find it. I'm clueless on what to do.

    Please help. Below is a strip down version of the code. Thanks!

    Please Login or Register  to view this content.
    foundcell brings up nothing, even if there's zeros in the column.

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Excel VBA Find Zero Value (Shows up as hyphen)

    Hello yusunghee,

    Your Code is looking for "Nothing".

    Please try it this way:

    Please Login or Register  to view this content.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Registered User
    Join Date
    04-15-2011
    Location
    Dallas,TX
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Excel VBA Find Zero Value (Shows up as hyphen)

    Hi Winon,

    Tried it still no luck. Attached is a sample of worksheet and macro.

    Thanks.
    Attached Files Attached Files

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Excel VBA Find Zero Value (Shows up as hyphen)

    Hello yusunghee,

    See the attached sample WorkBook, which in my opinion, gives you what you want with much more flexability.
    Attached Files Attached Files

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Excel VBA Find Zero Value (Shows up as hyphen)

    Hello yusunghee,

    So my first attempt failed.

    I accepted it as a challenge, and came up with Code (not very elegant) but it does what you want, and more.

    New sample WorkBook is attached, for your consideration.

    Also see the "Please consider" note at the bottom of this post.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    04-15-2011
    Location
    Dallas,TX
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Excel VBA Find Zero Value (Shows up as hyphen)

    Unfortunately, i'm still having no luck with this issue.

    The issue is the format of the cell. In that attached worksheet, which is winon's code, i inserted two formulas in cell c20 and c21. Both formulas are exactly the same, but the formatting is different. One is in the accounting format, but the other is in general. When I run the code, only the general formatted cell highlights.

    My real worksheet is in the accounting formatted code, so I don't want to change my worksheet's numbers into a general format. Anyone know what the issue is and how i can find / highlight the zero value thats in an accounting format?

    Thanks.
    Attached Files Attached Files

+ 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. [SOLVED] Function Arguments window shows result, cell shows a 0
    By fluffsmckenzie in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-09-2013, 05:48 PM
  2. [SOLVED] Vlookup only shows the first result, is there a method to negate the already existing find
    By mdggraham in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-20-2012, 05:45 AM
  3. All dates in excel changed now use hyphen, huh?
    By ge0rge in forum Excel General
    Replies: 3
    Last Post: 10-30-2008, 07:34 AM
  4. cell shows 20. Formula shows 20. why not 540/27
    By griswold in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  5. cell shows 20. Formula shows 20. why not 540/27
    By griswold 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