+ Reply to Thread
Results 1 to 2 of 2

Checking excel for errors/inconsistencies

  1. #1
    markx
    Guest

    Checking excel for errors/inconsistencies

    Hi folks,

    I'm trying to check my worksheets for errors and inconsistencies. For this,
    I thought to use some VBA code that would color the cells depending on if
    the content is the text, number, formula, reference, etc...

    I've already found the code for "formula-testing" (provided by Gord Dibben)
    which is like this:
    ---
    Sub colorcells()
    Dim Cel As Range
    For Each Cel In ActiveSheet.UsedRange
    If Cel.HasFormula Then
    Cel.Interior.ColorIndex = 24 '''-4142 for "No Fill"
    End If
    Next
    End Sub
    ---

    I would like to incorporate the test for other contents (with different
    colors), but apparently there is no such thing as "Cel.HasReference" or
    "Cel.HasText". For sure, I will explore VBA by myself, but some help from
    your side would be greatly appreciated!

    Mark

    PS: If you think that there are some other tests that may prove quite
    useful, pls don't hesitate to suggest it here:-)



  2. #2
    JulieD
    Guest

    Re: Checking excel for errors/inconsistencies

    Hi

    one way to figure these out is to record a macro that uses the functionality
    in edit / goto / special to select the different types of cells ...

    Hope this helps
    Cheers
    JulieD

    "markx" <[email protected]> wrote in message
    news:[email protected]...
    > Hi folks,
    >
    > I'm trying to check my worksheets for errors and inconsistencies. For
    > this,
    > I thought to use some VBA code that would color the cells depending on if
    > the content is the text, number, formula, reference, etc...
    >
    > I've already found the code for "formula-testing" (provided by Gord
    > Dibben)
    > which is like this:
    > ---
    > Sub colorcells()
    > Dim Cel As Range
    > For Each Cel In ActiveSheet.UsedRange
    > If Cel.HasFormula Then
    > Cel.Interior.ColorIndex = 24 '''-4142 for "No Fill"
    > End If
    > Next
    > End Sub
    > ---
    >
    > I would like to incorporate the test for other contents (with different
    > colors), but apparently there is no such thing as "Cel.HasReference" or
    > "Cel.HasText". For sure, I will explore VBA by myself, but some help from
    > your side would be greatly appreciated!
    >
    > Mark
    >
    > PS: If you think that there are some other tests that may prove quite
    > useful, pls don't hesitate to suggest it here:-)
    >
    >




+ 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