View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Andy77 Andy77 is offline
external usenet poster
 
Posts: 1
Default Quick n' dirty code to delete rows?

You can be more detailed that this, but it can get you
going in the right direction.

'Understand that you must determine how many columns are
necessary to check

Sub Delete_Rows ()

r = 1
'Check each Row
Do
If Not IsEmpty(Cells(r,c)) Then
'Check each column within that row
Do Until c = 7 'Checks until the 7th column
If IsEmpty(Cells(r,c + 1)) Then
Cells(r,c).EntireRow.Delete
Else
c = c + 1
End If
Loop
End If 'Set up for next row
c = 1
r = r + 1
Loop Until IsEmpty(Cells(r,c))
'Assumes that at least column A will not be missing data.
End Sub


---Original Message-----
Hello,

Can anyone write me a quick VBA example to delete an

entire row if a
particular cell within that row is empty? I need excel

to do this to multiple
rows until it gets to the end of the data.

Anyone?
.