asyamonique
Well-known Member
- Joined
- Jan 29, 2008
- Messages
- 1,280
- Office Version
- 2013
- Platform
- Windows
Code:
Dim rngCell As Range Dim lngMyRow As Long
Dim wsSourceTab As Worksheet
Application.ScreenUpdating = False
Set wsSourceTab = Sheets("MasterList") 'Sheet name with data. Change to suit.
With CreateObject("Scripting.Dictionary")
For Each rngCell In wsSourceTab.Range("d2:d" & wsSourceTab.Range("d" & Rows.Count).End(xlUp).Row) 'Works down from cell A2. Change to suit.
If Len(rngCell.Value) > 0 Then
If Not .Exists(rngCell.Value) Then
.Add rngCell.Value, rngCell.Value
If lngMyRow = 0 Then
lngMyRow = 8 'Initial output row is 2. Change to suit.
Else
lngMyRow = lngMyRow + 1
End If
wsSourceTab.Range("d" & rngCell.Row).Copy Destination:=wsSourceTab.Range("a" & lngMyRow)
End If
End If
Next rngCell
End With
Good Day,
With above code how can I change the copy destination if I needed to copy the datas to another sheet?
Code:
Copy Destination:=wsSourceTab.Range("a" & lngMyRow)