Powershell – 在Excel文档中运行search值后,获取单元格位置(例如B32)
一旦您在search后确认它存在,您将如何获取值的单元格位置?
例如,一旦脚本在每张表中find“应用程序名称”的单元格位置,那么我希望它被回显给我
$i=0 foreach ($b in $b_names) { $b = $b_names[$i] $sheet = $wb.Worksheets.Item($b) $range = $sheet.Range("B1").EntireColumn $s = $range.find("App Name") $i=$i+1 }
谢谢!
两件事情要尝试。
-
消息框
[System.Windows.Forms.MessageBox]::Show("Range Found: $s.address().tostring()", "Alert Title")
-
写主机
write-host "Range found: " $s.address().tostring()