remove duplicate with the current month

faizee

Board Regular
Joined
Jan 28, 2009
Messages
214
Office Version
  1. 2016
Platform
  1. Windows
i want to make list of unique record (after removing duplicate) of only last month (feb-12


RecordsDate
Rad5-Jan-12
faizan5-Feb-12
Cool5-Jan-12
Be5-Jan-12
Be5-Jan-12
Cool5-Jan-12
red5-Jan-12
Rad5-Jan-12
Too5-Jan-12
Super5-Feb-12
Be5-Feb-12
Super5-Feb-12
Rad5-Feb-12
Sioux5-Feb-12
Super5-Feb-12
Super5-Feb-12
Super5-Jan-12
Be5-Jan-12
Be5-Jan-12
Cool5-Jan-12
Sioux5-Jan-12
Cool5-Feb-12
Super5-Feb-12
Cool5-Feb-12
wdcbyhj5-Feb-12

<TBODY>
</TBODY><COLGROUP><COL><COL></COLGROUP>
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
so which list is the correct one?


Excel 2003
ABCDE
1After macro for deleting dupsAdvanced Filter Unique
2RecordsDateRecordsDate
3faizan5-Feb-12Rad5-Jan-12
4red5-Jan-12faizan5-Feb-12
5Too5-Jan-12Cool5-Jan-12
6Super5-Feb-12Be5-Jan-12
7Be5-Feb-12red5-Jan-12
8Super5-Feb-12Too5-Jan-12
9Rad5-Feb-12Super5-Feb-12
10Sioux5-Feb-12Be5-Feb-12
11Super5-Feb-12Rad5-Feb-12
12Super5-Feb-12Sioux5-Feb-12
13Cool5-Feb-12Super5-Jan-12
14Super5-Feb-12Sioux5-Jan-12
15Cool5-Feb-12Cool5-Feb-12
16wdcbyhj5-Feb-12wdcbyhj5-Feb-12
Sheet3
 
Upvote 0
How about this?

Code:
Sub fUnique()
On Error Resume Next
Dim r As Range, cel As Range
Dim nCol As Scripting.Dictionary
Set nCol = CreateObject("Scripting.Dictionary")
Set r = Range("B2", Range("B" & Rows.Count).End(xlUp))
    For Each cel In r
        If Month(cel) = 2 Then
            nCol.Add cel.Offset(, -1).Value, cel.Value
        End If
    Next cel
              
For x = 0 To nCol.Count
    Cells(x + 1, 4) = nCol.Keys(x)
    Cells(x + 1, 5) = nCol.Items(x)
Next x
End Sub
 
Upvote 0

Forum statistics

Threads
1,216,098
Messages
6,128,812
Members
449,468
Latest member
AGreen17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top