View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Doug Glancy Doug Glancy is offline
external usenet poster
 
Posts: 770
Default finding empty rows and deleting

I must have got this from Google Groups (archived NG postings, check it
out!) or Ron's web site. It deletes all blank rows in a sheet, actually any
row with a blank in column 1, same thing in your case. If you have some
blank rows outside your range of data that you want to keep, you'd have to
tailor.

Public Sub DeleteBlankRows()

'Ron De Bruin

Dim column_with_blanks As Long

column_with_blanks = 1

On Error Resume Next 'In case there are no blank rows

Columns(column_with_blanks).SpecialCells(xlCellTyp eBlanks).EntireRow.Delete
On Error GoTo 0

End Sub

hth,

Doug Glancy

"Ryan" wrote in message
...
I have range of data that varies. The data has empty rows of data. I need

to find the empty rows and delete them. Need help creating VBA code to do
this.