Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
nestint 2 loops
i am trying to go through each sheet in a workbook and remove the blank rows.
i am using this macro Sub RemoveBlankRows() Dim mySheet As Worksheet For Each mySheet In Worksheets mySheet.Select Dim FinalRow As Long Dim RowCounter As Long Dim ObjVariable As Object Set ObjVariable = Application.WorksheetFunction Application.ScreenUpdating = False FinalRow = ActiveSheet.UsedRange.Rows.Count For RowCounter = FinalRow To 1 Step -1 If ObjVariable.CountA(Rows(RowCounter)) = 0 Then Rows(RowCounter).Delete End If Next RowCounter Next my.Sheet End Sub -- however, i get the error message "Invalid Next control varialbe reference". Any suggestions? Thanks in advance for your help. aprilshowers |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
loops???? | Excel Worksheet Functions | |||
Loops | Excel Discussion (Misc queries) | |||
Loops | Excel Discussion (Misc queries) | |||
Loops... | Excel Discussion (Misc queries) | |||
Using For - Next Loops in VB | New Users to Excel |