Home |
Search |
Today's Posts |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oops!
Ron's reply is the perfect answer Mine was rubbish. Peter "PeterAtherton" wrote: "Terri Miller" wrote: I have been going through past posts, and they are very helpful. However, most of them speak to deleting rows with specific data or numbers. I would like to write a macro that delets all rows in which column A is empty or has anything other than a date format i.e. dd/mm/yy. Some cells have the text "DATE", some have "___", some are empty, etc. Thanks Terri I'd copy the data to a new sheet before running this. Sub test() Dim r, nr, col, ncol, c Application.ScreenUpdating = False Selection.SpecialCells(xlCellTypeLastCell).Select nr = ActiveCell.Row 'test format of each cell For r = 1 To nr Cells(r, 1).Select If ActiveCell.NumberFormat < "dd/mm/yy" _ Or IsEmpty(ActiveCell) _ Or Not Application.IsNumber(ActiveCell) Then ActiveCell.EntireRow.Delete End If Next Application.ScreenUpdating = True End Sub Peter Atherton |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
If cell empty delete row | Excel Discussion (Misc queries) | |||
Delete Empty Rows | Excel Discussion (Misc queries) | |||
delete empty rows between rows with text | Excel Discussion (Misc queries) | |||
Delete empty rows | Excel Programming | |||
how to delete empty row in vba | Excel Programming |