Press Alt + F11 keys simultaneously to display the Microsoft Visual Basic for Applications window. In the Microsoft Visual Basic for Applications window, click Insert Module, then copy and paste the following VBA code into the module window. VBA: Delete entire rows if zero value exist in certain column range in a worksheet. If MsgBox('delete entire column?' , vbOKCancel + vbExclamation) = vbCancel Then Exit Sub Selection.EntireColumn.Delete Case Else Exit Sub End Select End Sub. Hello, Thank you for the code. Would it be possible to create a VBA to add or delete columns specific to columns header. I have a set of 30 - 35 column headers.
I am trying to delete all rows that have blank cells in column A in a long dataset (over 60 000 rows in excel)
I have a VBA code that works great when I have less then aprox 32 000 cells:
Does anybody know a way so that it works on a large number of rows?
Thank you
![Vba Delete Column Vba Delete Column](https://cdn.wallstreetmojo.com/wp-content/uploads/2019/04/VBA-Delete-Column-Example-4-2.png)
![Excel vba delete column by number Excel vba delete column by number](https://cdn.wallstreetmojo.com/wp-content/uploads/2019/04/VBA-Delete-Column-Example-1-5.gif)
1 Answer
You could try:
Application.ScreenUpdating
toggles whether updates made in code are visible to the user, and trying Columns('A:A').SpecialCells(...
might save time because it doesn't actually have to select the cells - untested.