Are you writing your own code, trying to automate Excel via the UI, or working with one of the Excel VBOs on the DX? There is a deduplication method on the Range object in VBA. You can find more about it
here.
Unfortunately, this feature isn't included in the Excel VBOs provided by BP at the moment, but with the Microsoft documentation referenced above you should be able to add it to your local VBO.
Cheers,
------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------