Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
After data exported to excel file which contain about 20,000 rows and 20 columns, certain cells contain no data or value but do not belong to blank cells ( ie after using GoTo Special/Search for blanks cell ) I tried to delete entire rows that contain no data from the above file by using the codes in Excel 2007 below ( thanks to VBA Express ) and the result has no response Sub DeleteBlankRows() Dim Rw As Long, RwCnt As Long, Rng As Range Application.ScreenUpdating = False Application.Calculation = xlCalculationManual On Error GoTo Exits: If Selection.Rows.Count 1 Then Set Rng = Selection Else Set Rng = Range(Rows(1), Rows(ActiveSheet.Cells.SpecialCells(xlCellTypeLast Cell).Row())) End If RwCnt = 0 For Rw = Rng.Rows.Count To 1 Step -1 If Application.WorksheetFunction.CountA(Rng.Rows(Rw). EntireRow) = 0 Then Rng.Rows(Rw).EntireRow.Delete RwCnt = RwCnt + 1 End If Next Rw Exits: Application.ScreenUpdating = True Application.Calculation = xlCalculationAutomatic End Sub Any help will be much appreciated and thanks in advance as I'm VBA beginner Regards Len |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hpw do I delete multiple empty rows found between filled rows? | Excel Worksheet Functions | |||
How to Delete empty rows in excel in b/w rows with values | Excel Worksheet Functions | |||
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows | Excel Worksheet Functions | |||
Delete Rows with Empty Cells with empty column 1 | Excel Programming | |||
delete empty rows between rows with text | Excel Discussion (Misc queries) |