Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to delete empty rows. I copied this macro from Mcrosoft
Excel 2000 Power Programming with VBA by John Walkenbach. I have Excel 2003. The code below is identical to what is in the book except for the two 'Dim' statements. The macro is one of 4 modules in my personal.xls file. I get the following error message: Run time error '91.' Object variable or with block variable not set. Any help would be appreciated. Steve G Sub DeleteEmptyRows() Dim LastRow As Range Dim r As Integer LastRow = ActiveSheet.UsedRange.Rows.Count Application.ScreenUpdating = False For r = LastRow To 1 Step -1 If Application.WorksheetFunction.CountA(Rows(r)) = 0 _ Then Rows(r).Delete Next r End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
John Walkenbach - Ensuring that Data Validation is Not Deleted | Excel Programming | |||
to: John Walkenbach - Face ID add-in | Excel Programming | |||
John Walkenbach Color Palette (Repost) | Excel Programming | |||
John Walkenbach Color Palette | Excel Programming | |||
John Walkenbach Colour Palette | Excel Programming |