Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

In excel RemoveDuplicates() rows

$
0
0

Hi,

I want to delete some duplicate rows in excel. I recorded a macro in excel that does the work, Now I would like to convert that macro into Powershell.

Here is the Macro:

cells.Select

ActiveSheet.Range("A$1:$E$25").RemovesDuplicates Columns:4, Header:=xlYes

Here is what I tried so far:

$Range = $ws.range("D2:D25")

$Range.select()

$Range.RemoveDuplicates()

It runs with no errors but nothing happens.

Any ideas?



Viewing all articles
Browse latest Browse all 21975

Trending Articles