Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    restrict Scrolling?? (2003 sp2)

    greetings,
    I have a question regarding restricting scrolling to the RIGHT in a spreadsheet. I have data listed beyond a defined print area, and I am curious if I can disable the Right scroll?



    Thanks,
    Brad

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: restrict Scrolling?? (2003 sp2)

    You can set the scrollable area of a worksheet in Visual Basic, for example from the Immediate window in the Visual Basic Editor:

    ActiveSheet.ScrollArea = "A1:M50"

    or

    ActiveSheet.ScrollArea = "A:M"

    The former limits both horizontal and vertical scrolling, the latter limits only horizontal scrolling. If you want to allow unlimited scrolling again, set ScrollArea to an empty string:

    ActiveSheet.ScrollArea = ""

  3. #3
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: restrict Scrolling?? (2003 sp2)

    Thanks again!!!

    I do like this solution.....



    BRad

  4. #4
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: restrict Scrolling?? (2003 sp2)

    As a related item, can I set the Zoom to always be 100% and not allow the user to change?


    Brad

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: restrict Scrolling?? (2003 sp2)

    Additional remark: the scroll area is not saved with the workbook, so you must set it when the workbook is opened. You could set the zoom percentage to 100 at the same time.

    It's possible to disable changing the zoom percentage, but it's a lot of work top ensure that it'll only affect one worksheet. If you don't want the user to see rows and columns outside the print area, you're better off hiding all rows and all columns outside the print area.

    To set the scroll area and zoom when the workbook is opened, put the following code in the ThisWorkbook module of the workbook:

    Private Sub Workbook_Open()
    Worksheets("Sheet1").Activate
    ActiveSheet.ScrollArea = "A1:M20"
    ActiveWindow.Zoom = 100
    End Sub

    Substitute the appropriate sheet name and range.

  6. #6
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: restrict Scrolling?? (2003 sp2)

    Hans,
    thanks for the input. I will try the code, and hide the information as well.


    Brad

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •