• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How can I lock the scroll bar?

Guity


In the Scroll Up/Down event unless some criteria is met keep the scroll bar at its old value
 
Hui,

Can you please explain it more and tell me where to go to make this happen? Developer Tab?

Thanks,
 
Use the Active X scroll bars on the Developer Tab

Right click on them and view code
 
Alternate solution:

In the VB, under sheet properties, set a range in the Scroll Area. Limits the area the user can scroll to (so, might be able to scroll 2 pages worth, might not be able to scroll at all). The Scroll Up/Down events is probably the better path to go, but just in case you need to be able to display more than 1 screen length's worth of data.
 
Hui,

I can not find Active X Scroll Bars on the Developer Tab. I can insert a scroll bar tool. But I need the scroll bar of my sheet to be locked. When I insert the active x control, there are some codes, but the codes are not applicable in the Scroll Area under Sheet properties in VB Sheet.


Luke,

I see the Scroll Area under Sheet properties, but it doesn't accept my value and it says: Invalid property value. Even it didn't accept False property.


I need to lock my scroll bar for the sheet that I have dynamic charts.

Thank you for your time and the help
 
Guity,


If you need to lock the scroll area of your worksheet, put the below code on any Module and run the code by pressing F5, after that the Scroll Area for that sheet will remain fixed...


You will even not be able to click on any other cells which are outside the range you define.

[pre]
Code:
Sub LockArea()
Worksheets(1).ScrollArea = "A1:F10"
End Sub

To re-enable the entire sheet again use the below code

Sub UnlockLockArea()
Worksheets(1).ScrollArea = ""
End Sub
[/pre]
Hope this is what you were looking for...


~VijaySharma
 
Back
Top