How to lock horizontal scroll bar

manojbk

Board Regular
Joined
Mar 2, 2009
Messages
59
i want to lock the horizontal scroll bar in an excel sheet ..is it possible..
please hepl me
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
You can freeze the scroll area to a specific limit if that is what you are looking forward to ? In order to do that you will need a small code in VBA. Here is the line of code for locking the scrollbar on Sheet1:

Code:
Sheets("Sheet1").ScrollArea = "A1:F100"

Also you can remove the horizontal scrollbar in your Excel worksheet if that is what you want. You can accomplish this just by plonking this line of code in one of the Excel events:

Code:
ActiveWindow.DisplayHorizontalScrollBar = False

Does that help ?
 
Upvote 0
Thank u for ur quick response. my intention is to lock the sheet like a single page. it should not scroll vertical or horizontal .is it possible....
 
Upvote 0
my intention is to lock the sheet like a single page. it should not scroll vertical or horizontal .is it possible

Yes, it is possbile. Please use the line of code which I have posted first.
I guess you know how to use it ?
 
Upvote 0
What is the name of the worksheet that you want to lock the scroll area for in your Excel workbook ?
 
Upvote 0
Right click on the worksheet name "Master", select the option "view code". A VB Editor would open. Now, on the right hand side of the window just a little above the white area there are 2 dropdowns, namely, "General" & "Declarations". Now, select "Worksheet" in the General dropdown and than select "Activate" in the Declarations dropdown.

Copy and paste the code below with whatever code you find there in the white area after you perform the above steps:

Code:
Private Sub Worksheet_Activate()
ScrollArea = "A1:P40"
End Sub

Note: Please change the ranges in the code to suit your preferences.

Hope this helps you :biggrin:
 
Upvote 0
Old thread I know, but that was exactly what I was looking for. Thanks Stormseed.
 
Upvote 0

Forum statistics

Threads
1,214,621
Messages
6,120,563
Members
448,972
Latest member
Shantanu2024

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top