View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default How do I create a macro to remove blank rows...

This is untested, so if you get an error, post back.

Sub delRws()
Dim lr As Long
lr = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
Set rng = ActiveSheet.Range("A2:A" & lr)
For i = lr To 2 Step - 1
If ActiveSheet.Cells(i, 1).Value = "" Then
ActiveSheet.Cells(i, 1).EntireRow.Delete
End If
Next
End Sub



"1219Cookie" wrote in message
...
I have a worksheet has this formula in column A:
=IF('Task Rating'!B$6=0, 'Task Rating'!B$5, " ")

So it produces blank cell values, but retains the formula.
I've tried to use other macros from this discussion group, but they are
looking for blank cells, so it doesn't work.

I need to create a macro to remove the rows based on the value in any A
cell
where the value=""

Any suggestions?
--
Kim Cook
Technology Coordinator
General Mills