Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
I would like to write a basic macro that will search a column and delete a row if the cell is blank A 1 Orange 2 3 Apple 4 Pear 5 6 Grape For instance, I would like the macro to delete rows two and five in the above example. The number of rows to search will vary, so maybe it would be easier to start at the bottom of the worksheet and work up. Also, there may be text in other columns, so the whole row won't necessarily be blank. Thanks, Steve |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nevermind, I think I was able to find the answer from Dave Ritchie.
Thanks! Steve Sub EliminateBlankColumnC() On Error Resume Next ' In case there are no blanks Columns("C:C").SpecialCells(xlCellTypeBlanks).Enti reRow.Delete ActiveSheet.UsedRange 'Resets UsedRange for Excel 97 End Sub Steve Mackay wrote: Hi All, I would like to write a basic macro that will search a column and delete a row if the cell is blank A 1 Orange 2 3 Apple 4 Pear 5 6 Grape For instance, I would like the macro to delete rows two and five in the above example. The number of rows to search will vary, so maybe it would be easier to start at the bottom of the worksheet and work up. Also, there may be text in other columns, so the whole row won't necessarily be blank. Thanks, Steve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
To delete rows when more than one cell is blank | Excel Worksheet Functions | |||
Delete a row if blank cell | Excel Discussion (Misc queries) | |||
Delete a row if blank cell | Excel Discussion (Misc queries) | |||
Delete a row if blank cell | New Users to Excel | |||
Delete row if cell in col b is blank | Excel Discussion (Misc queries) |