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

Keep the first row Filtered using PS

$
0
0

I have an Excel worksheet with the first row as header, I highlight it and click Filter in Sort & Filter group of Data tab so I can manually sort by any column. However, after running vba code bellow, all Fillers on the first row are disappeared. Is there a way to keep them using PS? Thanks.

    $Range0 = $sheet.range("A1:W1")
    $Range0.AutoFilter() | Out-Null
    $Range1 = $sheet.range("A2:W100")
    $Range2 = $sheet.range("C2")
    $Range1.Sort($Range2)


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>