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