anyone know why lastrow is not correct ?
Code: Select all
Xl := ComObjActive("Excel.Application")
Xl.Visible := True
xlUp := -4162
For Sheet in Xl.Worksheets
Loop, % Sheet.Cells(Sheet.Rows.Count, 1).End(xlup).Row
{
Var1 := Sheet.Cells(A_Index, 1).Value
if (Var1 ~= "^\d.{3}\d{6}$")
MsgBox pass
else
MsgBox fail
}
return
Best regards
Henry