Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

2
I created a Macro to delete unwanted columns in a daily report that I pull. How do I make it delete certain rows based on specific criteria?
Post Flair (click to view more posts with a particular flair)
Post Body

Here's the code for the current Macro:

Sub CleanUp()
'
' CleanUp Macro
' Delete Unwanted Columns and Clean Up Data
'
' Keyboard Shortcut: Ctrl Shift M
'

    Columns("B:B").Select
    Selection.Delete Shift:=xlToLeft
    Selection.Delete Shift:=xlToLeft
    Selection.Delete Shift:=xlToLeft
    Columns("F:F").Select
    Selection.Delete Shift:=xlToLeft
    Selection.Delete Shift:=xlToLeft
    Columns("K:K").Select
    Selection.Delete Shift:=xlToLeft
    Columns("L:L").Select
    Selection.Delete Shift:=xlToLeft
    Selection.Delete Shift:=xlToLeft
    ActiveWindow.SmallScroll Down:=-2
End Sub

In addition to the above, I want it to do the following:

  1. Delete any rows where the value in column G is before June 1, 2016.

  2. Delete any row where the number in columns C, D or E is any value other than 1 - 5.

  3. Column A is supposed to be a unique identifier for every row. However, for some reason, it is possible there are duplicates. In cases where there are duplicates, I want the macro to delete all but the last one. The data is organized chronologically by time (which is in column H).

Author
Account Strength
50%
Account Age
8 years
Verified Email
No
Verified Flair
No
Total Karma
103
Link Karma
81
Comment Karma
22
Profile updated: 3 days ago
Posts updated: 11 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
8 years ago