如何让它自动确定行数(在 excel 文档中)以便能够为脚本设置参数?
#include <Excel Rewrite.au3>
Global $i = 1
Global $selector = '"of","restaurant","courtyard","licenced","landscapes","travel","specialist","testing","relay","imaging","environmental","associates"'
Global $sFormula = "=IF(OR(ISNUMBER(search("" ""&{" & $selector & "}&"" "","" ""&b" & $i & "&"" ""))),""YES"",""NO"")"
Global Const $xlCellTypeVisible = 12 ; All visible cells
Global $aData = $sFormula
Global $oExcel = _Excel_Open() ; Connect to Excel or open a new instance
Global $oWorkbook = _Excel_BookNew($oExcel) ; Create a new workbook
For $i = 0 To 100 step 1
Next
_Excel_RangeWrite($oWorkbook, Default, $aData, "A1:A100");
MsgBox(0, "RangeWrite Data", @error)
_Excel_FilterSet($oWorkbook, Default, $oWorkbook.Activesheet.UsedRange, 1, "NO") ; Only display even numbers
MsgBox(0, "FilterSet", @error)
Global $oRange = $oWorkbook.Activesheet.UsedRange.SpecialCells($xlCellTypeVisible) ; Only select visible rows
MsgBox(0, "Visible cells", @error)
$oRange.EntireRow.Delete ; delete visible rows