Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to delete rows
Hi Kirk,
Kirk P. wrote: I was hoping to create a VBA function that would identify empty or blank cells within a range, and then delete the row associated with that empty or blank cell. try this: Range("A1:A50").SpecialCells(xlCellTypeBlanks).Ent ireRow.Delete -- Regards Melanie Breden - Microsoft MVP für Excel - http://excel.codebooks.de (Das Excel-VBA Codebook) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to delete rows
I like to add this
Use this instead to avoid a error when there are no blanks Sub test() On Error Resume Next Range("A1:A50").SpecialCells(xlCellTypeBlanks).Ent ireRow.Delete On Error GoTo 0 End Sub Also this code can be a problem Read this KB http://support.microsoft.com/?kbid=832293 -- Regards Ron de Bruin http://www.rondebruin.nl "Melanie Breden" wrote in message ... Hi Kirk, Kirk P. wrote: I was hoping to create a VBA function that would identify empty or blank cells within a range, and then delete the row associated with that empty or blank cell. try this: Range("A1:A50").SpecialCells(xlCellTypeBlanks).Ent ireRow.Delete -- Regards Melanie Breden - Microsoft MVP für Excel - http://excel.codebooks.de (Das Excel-VBA Codebook) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to delete rows
Ron de Bruin wrote:
I like to add this Use this instead to avoid a error when there are no blanks Sub test() On Error Resume Next Range("A1:A50").SpecialCells(xlCellTypeBlanks).Ent ireRow.Delete On Error GoTo 0 End Sub Ron thanks you for the addition :-) -- Regards Melanie Breden - Microsoft MVP für Excel - http://excel.codebooks.de (Das Excel-VBA Codebook) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Delete all Rows Macro | Excel Discussion (Misc queries) | |||
delete rows-macro | Excel Discussion (Misc queries) | |||
macro to delete entire rows when column A is blank ...a quick macro | Excel Programming | |||
Macro to Delete Rows | Excel Programming | |||
HOW TO: Delete Rows with a Macro | Excel Programming |