Transpose and Removing Duplicates at same time
Closed
calflamesfann785
Posts
2
Registration date
Saturday 10 November 2012
Status
Member
Last seen
29 January 2013
-
29 Jan 2013 à 12:13
Blocked Profile - 30 Jan 2013 à 04:35
Blocked Profile - 30 Jan 2013 à 04:35
Related:
- Transpose and Removing Duplicates at same time
- Popcorn time apk - Download - Movies, series and TV
- Will itunes import duplicates - Guide
- Zelda ocarina of time rom - Download - Action and adventure
- Delete duplicates in excel - Guide
- Ps3 controller charging time - Guide
2 responses
venkat1926
Posts
1863
Registration date
Sunday 14 June 2009
Status
Contributor
Last seen
7 August 2021
811
30 Jan 2013 à 04:00
30 Jan 2013 à 04:00
try this macro
Sub test()
Dim id As Range, cid As Range, result As Range
Dim idfind As Range
Dim j As Integer, k As Integer
Dim miles As Long
Range("a1").CurrentRegion.Sort key1:=Range("A1"), Header:=xlYes
Set id = Range(Range("A1"), Range("a1").End(xlDown))
Set result = Range("A1").End(xlDown).Offset(5, 0)
MsgBox result.Address
id.AdvancedFilter xlFilterCopy, , result, True
Set result = Range(result.Offset(1, 0), result.End(xlDown))
For Each cid In result
k = WorksheetFunction.CountIf(id, cid)
Set idfind = id.Find(what:=cid, lookat:=xlWhole)
For j = 1 To k
miles = idfind.Offset(j - 1, 0).Offset(0, 1)
Cells(cid.Row, Columns.Count).End(xlToLeft).Offset(0, 1) = miles
Next j
Next cid
End Sub