I want to take the values in column A (50,000+ rows) and get only the unique values (there'll be ~2,000) into column B. I currently use the code below, which works perfectly EXCEPT that I've found the .RemoveDuplicates function -- whether run in VBA or via the Excel menus -- really screws up my sheet's formatting and conditional rules. So how can I have the entire process run in the background / in memory? I.e. is there a more elegant way to do it via VBA than copying all the values from col A to B and then running the .RemoveDuplicates function on col B (what the code below does)?
VBA Code:
Sub Dedup()
Range("col_A").Copy
Range("col_B").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("col_B").RemoveDuplicates Columns:=1, Header:= _
xlNo
End Sub