View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jeff.Gervais Jeff.Gervais is offline
external usenet poster
 
Posts: 1
Default Deleting Blank Rows at end of sheet

I was having this problem as well. I found this works but I am unsure why.

In the affected spread sheet hit CTRL+END which takes us down past a bunch
of blank rows.
Now go to the first blank row past all the good data in column A, hold
CTRL+shift+END then edit, delete, shift cells up (or left doesn't matter)
Try the CTRL+END again. We still go past the blank rows. (You would think
this would have fixed it but it hasn't.)
CTRL+HOME to the top of the sheet.

NOW, create this macro and run it.

Sub test()
Dim myRows As Long
myRows = ActiveSheet.UsedRange.Rows.Count
MsgBox (myRows)
End Sub

All it does is access UsedRange and display the count, but it displays the
correct row at the end of the good data range.

Try CTRL+END again and you get to the end of the good data without going
past all the blank rows.

Somehow accessing UsedRange made it update.