Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have this macro to tidy up data in columns which leaves blank rows at the
end of the range. I want to delete the blank rows but the line Worksheets("Disinfections").Range("pen_list").Spec ialCells(xlCellTypeBlanks).EntireRow.Delete Results in error 1004 No Cells Found. Here is the macro code --------------------------------------------- Sub sort_disinfection_columns() Worksheets("Disinfections").Range("pen_list").Copy Worksheets("Disinfections").Range("pen_list").Past eSpecial Paste:=xlPasteValues Range("A3:A52").Sort Key1:=Range("A3"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortTextAsNumbers Range("B3:B52").Sort Key1:=Range("B3"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortTextAsNumbers Range("C3:C52").Sort Key1:=Range("C3"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortTextAsNumbers Range("D3:D52").Sort Key1:=Range("D3"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortTextAsNumbers Range("E3:E52").Sort Key1:=Range("E3"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortTextAsNumbers Range("F3:F52").Sort Key1:=Range("F3"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortTextAsNumbers Range("G3:G52").Sort Key1:=Range("G3"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortTextAsNumbers Range("H3:H52").Sort Key1:=Range("H3"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortTextAsNumbers Range("I3:I52").Sort Key1:=Range("I3"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortTextAsNumbers Range("A1").Select 'Delete blank rows Worksheets("Disinfections").Range("pen_list").Spec ialCells(xlCellTypeBlanks).EntireRow.Delete 'Format remaining rows Range("pen_list").Select With Selection.Font .Name = "Arial Black" .Size = 24 End With Range("A1").Select End Sub --------------------------------------------- I've used this elsewhere with no problem so grateful for any help. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Work around to SpecialCells(xlCellTypeBlanks)... | Excel Discussion (Misc queries) | |||
Run-Time error '1004': No cells were found | Excel Programming | |||
Run-time error '1004': No cells were found | Excel Programming | |||
Run-time error '1004': No cells were found | Excel Programming | |||
specialcells(xlcelltypeblanks) | Excel Programming |