SOLVED

Deleting blank rows in excel..... but not deleting partially blank rows

Copper Contributor

Good day.

I'm not a novice in excel.

But this is quite an irritating task that I can't seem to get right with anyone's advice on the internet.

How can I delete blank rows in excel but not delete partially blank rows?

 

The advise given is on the Home tab> Editing> Find & Select> Go to Special> Blanks. Then under Home> Cells> Delete> Delete sheet rows.

This deletes partially blank rows as well.

 

Please help

 

 

12 Replies

Mr Douw,

How is your query doing?

If it is going nowhere, (I hope this is not a violation of forum policies.)

I am recommending some knowledgeable persons in the forum who can help you.

Misters Man Fai Chan, Matt Mickle, Wyn Hopkins, Jan Karel Pieterse, Jamil Mohammad (haven't heard from him though for quite some time now, but he is very helpful) .. to name a few.

Good luck..

best response confirmed by Douw de Beer (Copper Contributor)
Solution

Dear Community.

It was suggested that I should share the information that helped me on the forum so that everyone can benefit from it. I totally agree. So here it is:

 

Suppose your last column with data is column Z.

Add this formula to AA1:

=COUNTA(A1:Z1)

Double-click the fill handle to fill down (double-check if all rows are filled with the formula, if not, copy down as far as needed).

Now turn on filter and filter the table for the value of zero in that new column.

Use goto special, blanks now and do the delete. Then remove the filter.

Dear Douw de Beer,

 

It is an interesting way. Thanks for your sharing. I helped Mr Kim in his project before but did not think this way of solution. I recorded the macro as below:

 Cells.Select
Selection.AutoFilter
Range("H9").Select
ActiveSheet.Range("$A$1:$E$20").AutoFilter Field:=5, Criteria1:="0"
Rows("4:20").Select
Selection.Delete Shift:=xlUp
Range("C21").Select
Selection.AutoFilter

I  considered D as the last column and column E contains the formula of counta. 

 

Dear Douw de Beer,

 

It is an interesting way. Thanks for your sharing. I helped Mr Kim in his project before but did not think this way of solution. I recorded the macro as below:

 Cells.Select
Selection.AutoFilter
Range("H9").Select
ActiveSheet.Range("$A$1:$E$20").AutoFilter Field:=5, Criteria1:="0"
Rows("4:20").Select
Selection.Delete Shift:=xlUp
Range("C21").Select
Selection.AutoFilter

I  considered D as the last column and column E contains the formula of counta. 

 

I also have the same question.

I am not an expert by a longshot, but I do have to manage excel reports for work so it would help me to figure this out as well.

My reports are simple and don't use functions or queries. I just need to delete the rows that have no information at all. I've been unable to find step by step instructions for this which do not remove the rows with partial information. Any assistance would be appreciated. Thanks!

Ms. Burtis

copy your data to the sample attached and test it.

do not test directly on your work.. always have a back-up copy of your works.

hope this helps..

thanks

Hello,

Thanks that works in the document you submitted. How do I get it to work on my spreadsheet now? I tried to run it on a copy of work and it errors out (see attached).

Ms. Burtis

 

1. copy your data to the file I attached below (overwrite the previous one)

2. try it - if it worked then maybe you would want to save it as your filename.

hope this helps.

thank you.. 

Thank you Lorenzo Kim. Just starting with VBA myself and appreciate you base code.

In your sample sheet how would you change the code to check only one column for either 0 or no data? For example, there will always be data in column A and B, but I want to either Hide or Delete an entire row if Column C = 0 or is blank.

pls see attached file.

if there is a glitch or problem, pls inform me.

thanks..

Hide if Col C is blank or 0 is perfect. Thank you very much. Going to dissect all of them and learn, learn......
1 best response

Accepted Solutions
best response confirmed by Douw de Beer (Copper Contributor)
Solution

Dear Community.

It was suggested that I should share the information that helped me on the forum so that everyone can benefit from it. I totally agree. So here it is:

 

Suppose your last column with data is column Z.

Add this formula to AA1:

=COUNTA(A1:Z1)

Double-click the fill handle to fill down (double-check if all rows are filled with the formula, if not, copy down as far as needed).

Now turn on filter and filter the table for the value of zero in that new column.

Use goto special, blanks now and do the delete. Then remove the filter.

View solution in original post