Results 1 to 3 of 3

Make conditional formatting Macro dependent on cell number format

Threaded View

  1. #1
    Registered User
    Join Date
    03-09-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2007
    Posts
    13

    Make conditional formatting Macro dependent on cell number format

    Hi,

    My learning curve in vba continues. This macro shades cells if they are higher in value that left adjacent.

    I would like this macro to only apply to cells with number format: custom ##,##0;-##,##0 and ignore cells displaying currency: custom: \€#,##0;-\€#,##0. Please note these cell formats derive from a old macro I did not develop and dare not touch.

    Any suggestions for a solution are greatly appreciated.

    Sub conditshad()
    Dim i As Long
    Dim ws As Worksheet
    Dim c As Range
    i = Cells(Cells.Rows.Count, "E").End(xlUp).Row
    For Each ws In ActiveWorkbook.Worksheets
    For Each c In ws.Range("D5:g" & i)
    If c.Value > c.Offset(0, -1).Value Then c.Interior.ColorIndex = 4
    Next c
    Next ws
    End Sub
    Last edited by jbyrne; 03-15-2010 at 10:27 AM.

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