Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete row if no data, non-contiguous range problem
Hi my name is Nile.
I have the following code that checks every row from the bottom for any data and having found none deletes it, then goes on, it is limited to the certain range. It works fine with contiguous range such as ("A10:C20"), but does not work with non-contiguous ranges such as ("A10:C20, E10:G20")... can someone help me please? here is the code: -=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=- Dim i As Long 'turn off calculation and screenupdating. With Application ..Calculation = xlCalculationManual ..ScreenUpdating = False Range("A8:A58,D8:K58").Select 'working backwords because deleting rows. For i = Selection.Rows.Count To 1 Step -1 If WorksheetFunction.CountA(Selection.Rows(i)) = 0 Then Selection.Rows(i).EntireRow.Delete End If Next i ..Calculation = xlCalculationAutomatic ..ScreenUpdating = True End With -=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to automatically delete non-contiguous rows | Excel Discussion (Misc queries) | |||
Join non-contiguous ranges into one range via named range? | Excel Discussion (Misc queries) | |||
Adding Data to a Non-Contiguous Range in Excel 2007 | Charts and Charting in Excel | |||
delete row if no data, non-contiguous range problem | Excel Programming | |||
Non Contiguous range and loops | Excel Programming |