+ Reply to Thread
Results 1 to 7 of 7

Testing for a #VALUE!

  1. #1
    Registered User
    Join Date
    09-27-2007
    Posts
    4

    Testing for a #VALUE!

    Hi,
    I am trying to code a loop that tests a column of numbers (some cells contain #VALUE! errors). I want the loop to identify the cells with the #VALUE! in it and then make the cell yellow until it reaches the end of the data set.
    The code i have written so far can identify and make yellow any of the numbers in the data, however when a #VALUE! is added and i try to make it yellow i get a run time error 13 type mismatch.
    Here is the code i have:
    Please Login or Register  to view this content.
    Last edited by VBA Noob; 09-27-2007 at 03:24 AM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    How about

    Please Login or Register  to view this content.
    rylo

  3. #3
    Registered User
    Join Date
    02-23-2005
    Location
    Perth, Aus
    Posts
    32
    1. You wanna be putting that code in the:
    HTML Code: 
    2. You can do it either by:
    Please Login or Register  to view this content.
    in your macro or:

    or the other option is to use Conditional Formating within Excel itself.
    Format -> Conditional Formatting.

    Change "Cell Value Is" to "Formula Is" then add =ISERROR(cellref) e.g. in E4 put =ISERROR(E4).

    Copy and paste and your away.

    EDIT: Damn beaten by rylo!
    Last edited by downforce; 09-27-2007 at 02:04 AM.

  4. #4
    Registered User
    Join Date
    09-27-2007
    Posts
    4

    Reply to #VALUE! question

    Thanks for you response, Rylo i got your code to work.
    What if i want to change the cell value to 0, as opposed to yellow?

  5. #5
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Change

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    rylo

  6. #6
    Registered User
    Join Date
    09-27-2007
    Posts
    4

    Thumbs up

    thanks for your help, much appreciated

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Why not fix the errors?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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