View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
mudraker[_132_] mudraker[_132_] is offline
external usenet poster
 
Posts: 1
Default visual basic macro code for deleting referenced rows

Try this - checks a1 to a12 deleting rows if the cell is blank.



to find the last row used in a column replace
For r = 12 To 1 Step -1
with
For r = Range("a65536").End(xlUp).Row To 1 Step -1




Sub DelRow()
Dim r As Long
For r = 12 To 1 Step -1
If Cells(r, "a") = "" Then
Rows(r).Delete
End If
Next r
End Su

--
Message posted from http://www.ExcelForum.com