スクリプトのパラメーターを設定できるように、(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