Share via

Delete filtered rows via PowerShell

Anonymous
2017-01-06T05:41:08+00:00

Hi,

I'm processing IPv4 list using PowerShell in Excel. I can filter all IPv6 via autofilter method, but how can I delete these rows?

Using below method, I got the result that contain all rows I don't need.

$sheet.usedrange.autofilter(2,"fe80*",1)

Can anybody help on this?

Thanks,

Michael

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2017-01-06T07:18:40+00:00

$sheet.usedrange.autofilter(2,"fe80*",1)

$sheet.usedrange.specialcells(12).EntireRow.delete

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2017-01-06T09:05:00+00:00

    Hi, Asadulla Javed:

    Many thanks. It's working.

    BR,

    Was this answer helpful?

    0 comments No comments