- '
- '计算工作表有效数据行数
- '
- Public Function SheetRows(AcWorkSheet As Excel.Worksheet) As Long
- Dim OldRange As Excel.Range
- Set OldRange = pubExcelApp.ActiveCell
- AcWorkSheet.Range("A1").Activate
- SheetRows = pubExcelApp.ActiveCell.CurrentRegion.Rows.Count '有效数据行数
- OldRange.Activate '恢复工作表原来的光标位置
- End Function
|