#include <Excel.au3>
Local $var = FileOpenDialog("请选择要开启的档案", "@ScriptDir", " XLS(*.xls) ")
Local $oExcel = _Excelbookopen($var)
Local $aRc = StringRegExp($oExcel.Application.Selection.SpecialCells($xlCellTypeLastCell).Address(True, True, $xlR1C1), "\d+",3);共有几行几列
$oExcel.ActiveCell.CurrentRegion.Select;全选
;找"ID"所在Excel表行列位置(单元格位置)
Local $aIDCell[3]
$oFind = $oExcel.Selection.Find("ID")
If IsObj($oFind) Then
$aIDCell[0] = $oFind.Address(0,0);"ID"所在单元格Range
$aIDCell[1] = $oFind.Row;"ID"所在单元格行
$aIDCell[2] = $oFind.Column;"ID"所在单元格列
Else
MsgBox(4096,"Error","没有找到 ID 单元格")
EndIf
|