$xl=New-Object -ComObject excel.application $xl.visible=$true $wb=$xl.workbooks.open("C:\Users\lwang52\Desktop\部门.xlsx") $sheet=$wb.sheets.item(1) for($i=1;$i -lt $sheet.range("a65536").end(-4162).row;$i++) #xlDown -4121 Down. xlToLeft -4159 To left. xlToRight -4161 To right. xlUp -4162 Up. { Write-Host $sheet.range("A$i").text #A列对应每行的值 } $xl.displayAlerts=$False $wb.Close() $xl.Application.Quit()
本文链接: https://www.pstips.net/get-last-value-of-column-and-row.html
请尊重原作者和编辑的辛勤劳动,欢迎转载,并注明出处!
请尊重原作者和编辑的辛勤劳动,欢迎转载,并注明出处!