98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum 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
Resolved · 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 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
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Manually wrapping textTo manually wrap text, use the shortcut key Alt+Enter. |