Excel - Adjust Vertical Scroll Bar.
Solved/Closed
stranger-46
Posted messages
25
Status
Membre
-
messemble -
messemble -
Hello,
I'm looking to create a macro so that the vertical scrollbar (on the right side) automatically adjusts to the number of non-empty rows.
For example, I have a database with a thousand rows; by default, my vertical scrollbar is well-adjusted, meaning that when I select it and drag it all the way down, it reaches the height of my 1000th row. But if I make a mistake (like pressing "CTRL" + "Shift" + "Down Arrow" on an empty cell), I end up with a selection going down to row 65536. In this case, the vertical scrollbar is adjusted accordingly, and it's quite complicated to find my 1000th row by scrolling through the vertical scrollbar...
While searching online, I found the code: scrollbar1.max=range("cell").value but it doesn't work for me, giving the error: "Object required". Plus, nothing guarantees that it's the right code for my problem. I also found the term: "verticalscrollbar" which I think corresponds more closely to the vertical scrollbar, but how do I assign a value to it?
Does anyone have any ideas?
PS: I'm not very good at VBA, so I apologize if I've made any mistakes.
Thank you in advance.
--
If you don't know, ask; if you know, share.
I'm looking to create a macro so that the vertical scrollbar (on the right side) automatically adjusts to the number of non-empty rows.
For example, I have a database with a thousand rows; by default, my vertical scrollbar is well-adjusted, meaning that when I select it and drag it all the way down, it reaches the height of my 1000th row. But if I make a mistake (like pressing "CTRL" + "Shift" + "Down Arrow" on an empty cell), I end up with a selection going down to row 65536. In this case, the vertical scrollbar is adjusted accordingly, and it's quite complicated to find my 1000th row by scrolling through the vertical scrollbar...
While searching online, I found the code: scrollbar1.max=range("cell").value but it doesn't work for me, giving the error: "Object required". Plus, nothing guarantees that it's the right code for my problem. I also found the term: "verticalscrollbar" which I think corresponds more closely to the vertical scrollbar, but how do I assign a value to it?
Does anyone have any ideas?
PS: I'm not very good at VBA, so I apologize if I've made any mistakes.
Thank you in advance.
--
If you don't know, ask; if you know, share.
Configuration: Windows XP Internet Explorer 6.0 Excel 2002 SP3
13 réponses
Hello everyone,
With Excel 2003, there is a fairly simple technique to adjust the scrollbar on the right.
Select the row just after the end of your table and press "Ctrl+Shift+Down Arrow" to select the empty rows until the end of the existing rows in Excel, which is 65536.
Then press "Alt, E, S" in sequence (shortcut to delete). Go back to cell A1 and "Ctrl+S" (save).
Normally the scrollbar should adjust...
With Excel 2003, there is a fairly simple technique to adjust the scrollbar on the right.
Select the row just after the end of your table and press "Ctrl+Shift+Down Arrow" to select the empty rows until the end of the existing rows in Excel, which is 65536.
Then press "Alt, E, S" in sequence (shortcut to delete). Go back to cell A1 and "Ctrl+S" (save).
Normally the scrollbar should adjust...
louissir
Thank you very much for the info, great.
maellia
perfect, thank you very much!!!