• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Need help! To delete rows in a spreadsheet

Yuly Byrow

New Member
Hi There,

I have a spreadsheet with alot of rows approx 56000. I need to delete the (entire) row when a cell in column c is blank.

I have never used macros before (at least not vba ones) and I'm unsure why it isnt working. The script I wrote for some reason is deleting rows when a cell is not blank. Any help would really be appreciated!

Thanks!

Yuly
 
Hi Yuly,

Did you try to filter on blanks and delete all rows, then to remove the filters to get a table without blank rows? If you need a macro based solution, you can record a macro following these steps and then fine tune following your needs.

Does it help?
 
Hi Yuly,​
I know why your code is bad (logical conception error) but you have to post it to confirm that​
and to get a good return code …​
Aurelie (french spoken ?) there is a direct way with no filter in VBA.​
But for sure it's the easy way with the Macro Recorder …​
 
This is what the script needs to look like. Note that I slaved away at writing this. ;)
Code:
Sub DeleteBlanks()
ActiveSheet.Range("C:C").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End Sub
 
You're welcome !​
I was just waiting for an answer to explain why … before posting the code …​
 
Back
Top