deleting blanks cells rows

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Deleting blanks cells in rows of data

Deleting blanks cells in rows of data

resolvedResolved · Low Priority · Version 2007

Soo has attended:
Excel Advanced course
Excel Advanced course
Excel VBA Intro Intermediate course

Deleting blanks cells in rows of data

We tried doing this in the class. I couldn't do this when there are more than one rows of blanks one after another. Could you please send/email me the solution to this class exercise? Thank you.

RE: Deleting blanks cells in rows of data

Hi Soo,

Thank you for your question.

The code below will delete the rows that are blank using columns a:h which is the first and last column on the sheet I used to write and test it.

Please try this code below:

Public Sub DeleteAllBlankRows()
Dim WRBK As Workbook
Dim SHT As Worksheet

Set WRBK = ActiveWorkbook
Set SHT = WRBK.Sheets("TEAMBASE")
SHT.Columns("A:H").SpecialCells(xlBlanks).EntireRow.Delete


End Sub

I hope this helps.

Regards

Simon

Wed 6 Apr 2011: Automatically marked as resolved.

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Manually wrapping text

To manually wrap text, use the shortcut key Alt+Enter.

To cancel manual text wrapping, simply delete the new line.

View all Excel hints and tips


Server loaded in 0.08 secs.