Or if you can't get that to work, you can try this.
About your second question, you can simply loop though the sheets collection in the workbook.Code:Sub GetEmptyRows() Dim LastRow As Long Dim r As Long LastRow = XL.ActiveSheet.UsedRange.Row - 1 + XL.ActiveSheet.UsedRange.Rows.Count XL.ScreenUpdating = False For r = 1 To LastRow If XL.CountA(XL.ActiveSheet.Rows(r)) = 0 Then MsgBox r End If Next r End Sub
Code:Dim SH As Excel.Worksheet For Each SH In XL.ActiveWorkbook.Sheets MsgBox SH.Name Next




Reply With Quote