As part of a larger macro, I'm trying to copy a range from one sheet to another sheet, remove the duplicates, and set the remaining unique values as a range. I've written the below that works in principal, but after removing duplicates and setting the remaining cells as a range, the last cell in the range is always a blank one. How can I ignore this blank cell, so my range is on the unique values?
lr = Data.Cells(Rows.Count, "B").End(xlUp).Row
Data.Range("B5:B" & lr).Copy Sheets("Index").Range("B1")
Sheets("Index").Range("B1:B10000").Copy
Sheets("Index").Range("B1").PasteSpecial xlPasteValues
Sheets("Index").Range("B1:B10000").RemoveDuplicates Columns:=1, Header:=xlNo
Application.CutCopyMode = False
lr = Sheets("Index").Cells(Rows.Count, "B").End(xlUp).Row
Set MCH = Sheets("Index").Range("B1:B" & lr)
FYI the reason I'm copying paste values with the range is because its copying a 'helper' column that combines 2 names, and my macro didn't work without doing that. If there is a more efficient way, I'm all ears.