tahirih
asked on
Excel - delete rows - if condition
Hi,
Is there a way to delete rows from a worksheet if the cell in column A is blank? This would be performed on all sheets in the workbook, so I am not sure if there is a macro mechanism for this.
Thank you
Is there a way to delete rows from a worksheet if the cell in column A is blank? This would be performed on all sheets in the workbook, so I am not sure if there is a macro mechanism for this.
Thank you
ASKER
Only if you have the time - this would be wonderful.
Again, I would want to remove rows from all sheets where the cell in column A for that row is blank.
Thank you.
Again, I would want to remove rows from all sheets where the cell in column A for that row is blank.
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
well, byundt just shifted me... his solution work just fine
The manual equivalent to the macro is:
1) Select column A
2) F5 and click the Special Cells... button at the bottom of the resulting dialog
3) Choose the option for Blanks
4) Use the Home...Delete...Delete Sheet Rows menu item (in Excel 2010)
1) Select column A
2) F5 and click the Special Cells... button at the bottom of the resulting dialog
3) Choose the option for Blanks
4) Use the Home...Delete...Delete Sheet Rows menu item (in Excel 2010)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You might have to edit the code depending on the column that you are looking for the blanks in.
ASKER
Thank you everyone! I will be revisiting this project in a bit - so your patience is appreciated during the interim.
tahirih,
Brad's suggestion should work quite well. The only caveat is that if you have >16k rows in your source data, then there is a possibility that SpecialCells will fail. (SpecialCells fails if it returns >8192 distinct areas.)
The usual workaround for that is to sort the data first.
Patrick
Brad's suggestion should work quite well. The only caveat is that if you have >16k rows in your source data, then there is a possibility that SpecialCells will fail. (SpecialCells fails if it returns >8192 distinct areas.)
The usual workaround for that is to sort the data first.
Patrick
ASKER
Thank you everyone.
I can write a macro for you if you want