Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Dave and Peter,
The ActiveSheet.UsedRange seems to do the trick. ken |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
vertical scrollbar in Excel | Excel Discussion (Misc queries) | |||
Split, the vertical scrollbar is half way down the spreedsheet | Excel Discussion (Misc queries) | |||
Scrollbar, vertical | Excel Discussion (Misc queries) | |||
Lower Boundary of Vertical Scrollbar | Excel Discussion (Misc queries) | |||
Remove vertical scrollbar from spreadsheet in VBA code? | Excel Programming |