deleting blanks cells rows
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

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

replyReply Fri 18 Mar 2011, 15:53Delegate Soo said...

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.

For upcoming training course dates see: Pricing & availability

replyReply Wed 30 Mar 2011, 15:26Trainer Simon said...

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.

 

Please browse our web site to find out more about
training+excel+microsoft and other Microsoft training courses.

Excel tip:

Purchase excel

Buy MS Excel on Amazon.com

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard