Reputation: 13216
I would like to to search for blank cells in an Excel spreadsheet from a referenced row ($startRow) but instead Powershell searches the whole column (it starts at row 1).
How can I get it to start explicitly from $startRow.
$startRow = 3
$pointer = $sh.cells.item($startRow,2).EntireColumn.find("").Address()
$pointer
Upvotes: 0
Views: 1564
Reputation: 7638
Given that $sh.cells
is most likely a collection, I suggest this:
# If cells is actually a dictionary/hashtable:
#$sh.cells.GetEnumerator() |
# if cells is an array:
$sh.cells |
Select -Skip $startRow |
ForEach-Object {
$_.EntireColumn.find("").Address()
}
Upvotes: 1