View Single Post
  #3   Report Post  
Gary''s Student
 
Posts: n/a
Default Delete row if cell in col b is blank

Try:

Sub rowremover()
Dim i As Long
For i = 65536 To 1 Step -1
If IsEmpty(Cells(i, 2)) Then
Rows(i).Select
Selection.Delete Shift:=xlUp
End If
Next
End Sub

Without VBA, just sort on column B and discard the blanks.
--


Gary's Student


"claytorm" wrote:


Hi

I have a large sheet and need a macro to delete any row which does not
have a value in column B. So, if B32 was blank, the whole of row 32
would be deleted. Can anyone come up with a simple macro to do this?

Thanks,

Bertie


--
claytorm
------------------------------------------------------------------------
claytorm's Profile: http://www.excelforum.com/member.php...o&userid=11610
View this thread: http://www.excelforum.com/showthread...hreadid=483223