Results 1 to 11 of 11

Deleting rows based on Conditional Formatting

Threaded View

  1. #1
    Registered User
    Join Date
    06-10-2009
    Location
    Montreal
    MS-Off Ver
    Excel 2003
    Posts
    10

    Deleting rows based on Conditional Formatting

    Hi,

    I'm very new to VBA programming for excel macros and I need some help. I'm trying to get Excel to delete entire rows based on the conditional formating i'm using.

    Basically, I want to get rid of all the rows that are of a certain color (let's say green, InteriorColor = 4). I've already come up with a way to delete rows based on color, but I have to take into account the Conditional formating i'm using.

    Here's what I already have:

    Option Explicit
    Sub DeleteGreenRows()
    Dim LR As Long, a As Long
    Application.ScreenUpdating = False
    LR = Cells(Rows.Count, 1).End(xlUp).Row
    For a = LR To 1 Step -1
      If Cells(a, 1).FormatConditions.InteriorColor = 4 Then
        Rows(a).EntireRow.Delete
      End If
    Next a
    Application.ScreenUpdating = True
    End Sub
    Any help would be awesome. Thanks!
    Last edited by Yobari; 06-11-2009 at 11:22 AM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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