View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Pedros[_15_] Pedros[_15_] is offline
external usenet poster
 
Posts: 1
Default Deleting blanks rows based on multiple criteria


Sorry guys I have answered my own question:

Sub DeleteRows()
Dim theRange As Range
Dim lastRow&, firstRow&, x&
Set theRange = ActiveSheet.UsedRange
lastRow = theRange.Cells(theRange.Cells.Count).Row
firstRow = theRange.Cells(1).Row
For x = lastRow To firstRow Step -1
If Cells(x, 2) = "" And Cells(x, 5) = "" Then
Rows(x).Delete
End If
Next
End Sub


--
Pedros
------------------------------------------------------------------------
Pedros's Profile: http://www.excelforum.com/member.php...o&userid=28202
View this thread: http://www.excelforum.com/showthread...hreadid=565462