EdwardSurrey
New Member
- Joined
- May 13, 2015
- Messages
- 36
- Office Version
- 365
- Platform
- Windows
Hello
I have the following VBA code which moves unique values from a range to another worksheet.
The only issue is that does not exclude blanks - so it always copies one. Is there any modification I can make to skip the blanks?
Sub GetUniques()
Dim d As Object, c As Variant, i As Long, lr As Long
Set d = CreateObject("Scripting.Dictionary")
lr = Cells(Rows.Count, 1).End(xlUp).Row
c = Worksheets("Tracker (2022)").Range("B7:B893" & lr)
For i = 1 To UBound(c, 1)
d(c(i, 1)) = 1
Next i
Worksheets("Win Loss Report").Range("B16").Resize(d.Count) = Application.Transpose(d.keys)
End Sub
Thanks!
I have the following VBA code which moves unique values from a range to another worksheet.
The only issue is that does not exclude blanks - so it always copies one. Is there any modification I can make to skip the blanks?
Sub GetUniques()
Dim d As Object, c As Variant, i As Long, lr As Long
Set d = CreateObject("Scripting.Dictionary")
lr = Cells(Rows.Count, 1).End(xlUp).Row
c = Worksheets("Tracker (2022)").Range("B7:B893" & lr)
For i = 1 To UBound(c, 1)
d(c(i, 1)) = 1
Next i
Worksheets("Win Loss Report").Range("B16").Resize(d.Count) = Application.Transpose(d.keys)
End Sub
Thanks!