Try...
Private Sub CommandButton2_Click()
Dim n&
With Application
.ScreenUpdating = False
.EnableEvents = False '//optional
End With
With Range("g5:g14")
For n = 10 To 1 Step -1
If .Cells(n) = "" Then .Rows(n).Delete
Next 'n
End With
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub
...so your loop only acts on the target range!
--
Garry
Free usenet access at
http://www.eternal-september.org
Classic
VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.
vb.general.discussion