Consulting

Results 1 to 2 of 2

Thread: Cell format verification

  1. #1

    Cell format verification

    Hi guys,

    I need to make a sub to verify if a set of cells has changed format regarding another cell (like the sample cell format).

    I haven't seen anything that lets me do this in terms of code. Perhaps someone could help me.

    thanks!

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Welcome to VBAX
    [vba]Sub Formats()
    Dim cel As Range
    For Each cel In Selection
    If cel.NumberFormat <> Range("A1").NumberFormat Then
    cel.Interior.ColorIndex = 6
    End If
    Next
    End Sub
    [/vba]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •