View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Simon Lloyd[_838_] Simon Lloyd[_838_] is offline
external usenet poster
 
Posts: 1
Default How can I Delete rows were the first cell is blank?


This should do it just place it in a module and use a shortcut or button
to start it.....DO NOT change the range to Range("A:A") as it will run
the macro for ages trying to delete every row that statrs with a
blank!
Hope this helps
Regards
Simon

Sub Blankdelete()
Dim rng As Range
Dim mycell
Set rng = Range("A1:A40")
For Each mycell In rng
If mycell.Value = "" Then
mycell.EntireRow.Delete
End If
Next
End Sub


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=564767