Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default How do I update the Vertical scrollbar

When I bring up Excel, the vertical scrollbar "knows" where the last row is
on the worksheet. Or, in other words, if I drag the scrollbar all the way to
the bottom, then the last row with data in it is also at the bottom. My
problem is the following:

Let's say I have 1000 filled rows. Then I delete the last 500 rows. The
vertical scrollbar when dragged to the bottom still thinks the bottom 500
rows are still there. The only way I can get the scrollbar to update is to
exit Excel and come back in. Since I am doing my deletions in VB, I would
like to get the scrollbar updated in VB also. However, I can't even do it
manually!!
Any thoughts??
thanks,
ken


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How do I update the Vertical scrollbar

Debra Dalgleish shows techniques to reset that last used cell:
http://contextures.com/xlfaqApp.html#Unused

Ken Soenen wrote:

When I bring up Excel, the vertical scrollbar "knows" where the last row is
on the worksheet. Or, in other words, if I drag the scrollbar all the way to
the bottom, then the last row with data in it is also at the bottom. My
problem is the following:

Let's say I have 1000 filled rows. Then I delete the last 500 rows. The
vertical scrollbar when dragged to the bottom still thinks the bottom 500
rows are still there. The only way I can get the scrollbar to update is to
exit Excel and come back in. Since I am doing my deletions in VB, I would
like to get the scrollbar updated in VB also. However, I can't even do it
manually!!
Any thoughts??
thanks,
ken


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default How do I update the Vertical scrollbar

Hi Ken,

If you say your scroll bars update when you re-open your file I assume there
were no formats in the deleted range. In which case simply a UsedRange
statement might reset, if you're lucky! If not see Debra Dalgleish's page as
suggested by Dave.

Sub test()
[a1:a1000] = 1
[a1:iv1] = 1
End Sub

Sub test2()
[a1:a1000].Clear
[a1:iv1].Clear
ActiveSheet.UsedRange
End Sub

Regards,
Peter T

"Ken Soenen" wrote in message
...
When I bring up Excel, the vertical scrollbar "knows" where the last row

is
on the worksheet. Or, in other words, if I drag the scrollbar all the way

to
the bottom, then the last row with data in it is also at the bottom. My
problem is the following:

Let's say I have 1000 filled rows. Then I delete the last 500 rows. The
vertical scrollbar when dragged to the bottom still thinks the bottom 500
rows are still there. The only way I can get the scrollbar to update is to
exit Excel and come back in. Since I am doing my deletions in VB, I would
like to get the scrollbar updated in VB also. However, I can't even do it
manually!!
Any thoughts??
thanks,
ken




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default How do I update the Vertical scrollbar

Thanks Dave and Peter,
The ActiveSheet.UsedRange seems to do
the trick.

ken


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
vertical scrollbar in Excel a0xbjzz Excel Discussion (Misc queries) 1 July 16th 08 08:29 PM
Split, the vertical scrollbar is half way down the spreedsheet Kathy Excel Discussion (Misc queries) 2 April 20th 08 02:11 PM
Scrollbar, vertical jrich15322 Excel Discussion (Misc queries) 6 October 5th 06 12:53 PM
Lower Boundary of Vertical Scrollbar noplasma Excel Discussion (Misc queries) 0 January 5th 06 05:24 PM
Remove vertical scrollbar from spreadsheet in VBA code? Paul Excel Programming 2 February 8th 04 12:26 AM


All times are GMT +1. The time now is 05:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"