+ Reply to Thread
Results 1 to 26 of 26

Code to stop scroll

  1. #1
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690

    Code to stop scroll

    hi guys
    is there anyway to stop screen scroll?
    so that you can only see the visible cells at opening of workbook?
    regards
    Last edited by stevesunfold; 12-26-2008 at 06:37 PM.

  2. #2
    Forum Contributor
    Join Date
    04-21-2007
    Location
    Lima, Peru
    MS-Off Ver
    2000, 2007, 2010
    Posts
    674

    Screen scrolling

    HI

    The following code in a sheet module will restrict scrolling on that sheet

    Please Login or Register  to view this content.
    or it could be in the "This Workbook" module and set on opening for all relevant sheets

    The property is cleared on saving the workbook and must be reset each time

    Regards

    Jeff

  3. #3
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    hi jeff
    thanks
    but its still scrolling

  4. #4
    Forum Contributor
    Join Date
    04-21-2007
    Location
    Lima, Peru
    MS-Off Ver
    2000, 2007, 2010
    Posts
    674

    Scrolling limits

    HI

    Attached is an example sheet that limits scrolling on sheet 1 to the range A1 to M50.

    Regards

    Jeff
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    terrific
    work a treat
    thanks jeff
    how sad are we on xmas day ? lol

  6. #6
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    hi solna
    im trying this in a different workbook and doing as i did before but it lets me scroll to where i like

    is this other code affecting it?
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try selecting another sheet then go back to the sheet with the code. Code only works when you activate the sheet.

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  8. #8
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    Ah i see now
    hmmmmm is there anyway this could be permanent please?

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    In the ThisWorkbook module:
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  10. #10
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    hi shg
    nice to see you again
    im getting compile error in hidden module: this workbook message
    i have changed Sheet1 to working sheet which is what its callled

  11. #11
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    ignore shg
    i thinks its because i had two Private Sub Workbook_Open()
    one with nothing in it
    its ok now thank you once again

    i take it
    its possible to add any other sheets i would like to

  12. #12
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Try it, Steve.

  13. #13
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    i actually thought that as soon as i posted it shg
    trouble is im scared i will undo all the work ive previously done
    but im only adding another line

  14. #14
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    You don't need code to set the scroll area. Press Alt + F11 > Select sheet and under properties add the range to scroll

    http://www.excel-vba.com/zz-vba-4-4.gif

    VBA Noob

  15. #15
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    vba
    would i use this reference?
    a1:s20

    its ok noticed
    $A$1:$S$20
    Last edited by stevesunfold; 12-26-2008 at 06:31 PM.

  16. #16
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    I'd use Noob's approach.

  17. #17
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    cool thanks guys
    you guys are blooming geniuses

  18. #18
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    perhaps not as perfect as i thought
    if i save it then reopen it
    it doesnt stop the scroll where as shg's way does

  19. #19
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Hmm.

    I'm surprised that doesn't persist.

  20. #20
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    yours does to be fair

  21. #21
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    its weird because when i save it its got the refences there
    but when i reopen the workbook the references are empty

  22. #22
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Mine does because it runs every time the workbook opens.

  23. #23
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    i will keep to yours now if i know that works
    is 4.4mb large for excel file?

  24. #24
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    It's large compared to the size of the files I work with. I have fairly complex workbooks I use for pricing, and they're typically 500K. The most complex workbook I ever built was about 5MB.

    The only ones I have that are larger are just gobs of data.

  25. #25
    Registered User
    Join Date
    12-23-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Scrolling limits

    Thankyou for the attachment of the scrolling limit. But how do I get the scrolling working with other information in it such as charts and tables. I tried the same procedure but just doesn't seem to be working

  26. #26
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Code to stop scroll

    Welcome to the forum.

    Please take a few minutes to read the forum rules, and then start your own thread.

    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1