+ Reply to Thread
Results 1 to 12 of 12

Delete Row Based on Color

Hybrid View

  1. #1
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Delete Row Based on Color

    Hello trevor2524,

    Was this macro also created using Excel 2013 or an earlier version?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  2. #2
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    214

    Re: Delete Row Based on Color

    It was also created using Excel 2013. Here is the code I used to find the duplicates and mark them as red.
    Sub FindDups()
       '
       ' NOTE: You must select the first cell in the column and
       ' make sure that the column is sorted before running this macro
       '
    Application.ScreenUpdating = False
       FirstItem = ActiveCell.Value
       SecondItem = ActiveCell.Offset(1, 0).Value
       Offsetcount = 1
       Do While ActiveCell <> ""
          If FirstItem = SecondItem Then
            ActiveCell.Offset(0, 0).Interior.Color = RGB(255, 0, 0)
            ActiveCell.Offset(Offsetcount, 0).Interior.Color = RGB(255, 0, 0)
            Offsetcount = Offsetcount + 1
            SecondItem = ActiveCell.Offset(Offsetcount, 0).Value
          Else
            ActiveCell.Offset(Offsetcount, 0).Select
            FirstItem = ActiveCell.Value
            SecondItem = ActiveCell.Offset(1, 0).Value
            Offsetcount = 1
          End If
          
       Loop
    
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. delete a row based on color of cell
    By karimretina in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-25-2014, 05:18 AM
  2. [SOLVED] Delete row based on red color font
    By Jhon Mustofa in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-02-2014, 10:02 AM
  3. Delete Columns Based On Fill Color
    By jlkirk in forum Excel General
    Replies: 7
    Last Post: 01-28-2013, 02:00 PM
  4. delete rows based on fill color
    By schueyisking in forum Excel General
    Replies: 1
    Last Post: 08-25-2008, 10:28 AM
  5. Delete Rows Based On Color
    By Tommyweather in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-01-2008, 04:24 AM

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