Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
deleting rows with blank cells after a specified column?
Hello. I have a question regarding row deletion. Is there a macro
that allows me to delete entire rows if all cells beyond a specified column are blank? For example, if cells in row 5 are all blank after column C, how do I delete that entire row (and all rows like that in the entire spreadsheet)? If there is data in any one or more cells after column C, I do not wish to remove that row. I appreciate your help. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
deleting rows with blank cells after a specified column?
This should do it. I have included line continuatin character (space and
underscore) for one lines Sub countcplus() lr = Cells.Find("*", Cells(Rows.Count, _ Columns.Count), , , xlByRows, xlPrevious).Row For i = lr To 1 Step -1 If Cells(i, Columns.Count).End(xlToLeft).Column _ < 4 Then Rows(i).Delete Next i End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "MYR" wrote in message ... Hello. I have a question regarding row deletion. Is there a macro that allows me to delete entire rows if all cells beyond a specified column are blank? For example, if cells in row 5 are all blank after column C, how do I delete that entire row (and all rows like that in the entire spreadsheet)? If there is data in any one or more cells after column C, I do not wish to remove that row. I appreciate your help. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
deleting rows with blank cells after a specified column?
On Jan 9, 11:34*am, "Don Guillett" wrote:
This should do it. I have included line continuatin character (space and underscore) for one lines Sub countcplus() lr = Cells.Find("*", Cells(Rows.Count, _ Columns.Count), , , xlByRows, xlPrevious).Row For i = lr To 1 Step -1 If Cells(i, Columns.Count).End(xlToLeft).Column _ < 4 Then Rows(i).Delete Next i End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "MYR" wrote in message ... Hello. *I have a question regarding row deletion. *Is there a macro that allows me to delete entire rows if all cells beyond a specified column are blank? For example, if cells in row 5 are all blank after column C, how do I delete that entire row (and all rows like that in the entire spreadsheet)? *If there is data in any one or more cells after column C, I do not wish to remove that row. *I appreciate your help. Yes! That worked perfectly. Thanks for your time. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
deleting rows with blank cells after a specified column?
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MACRO HELP - deleting rows containing a range of blank cells | Excel Discussion (Misc queries) | |||
Deleting blank rows | Excel Worksheet Functions | |||
Deleting Blank Rows | New Users to Excel | |||
Deleting blank cells in a column | Excel Discussion (Misc queries) | |||
Deleting rows with blank cells | Excel Worksheet Functions |