刚刚在这里询问了一个powershell问题Finding excel cell reference,我需要添加它。
我最终得到的整体代码如下。
$filePath = "c:\temp\test.xlsx"
if (test-path $filePath) {
$wb = $xl.Workbooks.Open($filePath)
$ws = $wb.Worksheets.Item("sheet1")
if ([bool]$ws.cells.find("German Baseload")) {write-host $ws.cells.find("German Baseload").address(0, 0, 1, 0)}
}
这将返回 F25 的单元格引用,这是字符串所在的位置,基于此我想在单元格引用 G25 中测试它旁边的单元格,我的问题是如何向 F25 添加一列?