View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Blank rows at Bottom, over 60,000 of them - how to remove ???

This routine will search for the first empty row and delete this row and all
rows below it. It appears to set Activesheet.Usedrange correctly and may fix
your scroll problem:

Sub gsnu()
Dim j As Long
Dim i As Long
Dim rr As Range
Dim s As String

Set rr = ActiveSheet.UsedRange

j = rr.Rows.Count + rr.Row

For i = 1 To j
If Application.CountA(Rows(i)) = 0 Then
s = i & ":65536"
Rows(s).Delete Shift:=xlUp
Exit Sub
End If
Next i
End Sub
--
Gary's Student


"Kevin" wrote:

I already searched this and found several macros, but they do not
work.

Normally when you have a lot of rows of data - you can click the
scrollbar button and drag down to the bottom to see that last row of
data.

I have a worksheet with data only in Rows 1 to 2500. But when I click
on the scroll button and drag down, it quickly passes the last row of
data and scrolls down way past it - to row 64187. I have deleted all
the blank rows below row 2500, and they still shows up as far as the
scroll button goes.

Any ideas?