Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Sep 2001
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Color Recognition (English)

    Is there way to have a macro that reads a column, and if the color of a cell is black, then based on that delete the entire row?

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Color Recognition (English)

    Something like this should do it:

    <pre>Public Sub DeletBlack()
    Dim I As Long
    For I = 65535 To 0 Step -1
    With ActiveSheet.Range("A1").Offset(I, 0)
    If .Interior.ColorIndex = 1 Then
    .EntireRow.Delete
    End If
    End With
    Next I
    End Sub
    </pre>

    Legare Coleman

  3. #3
    Lounger
    Join Date
    Sep 2001
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Color Recognition (English)

    Thanks so much! It worked perfectly.

Posting Permissions

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