+ Reply to Thread
Results 1 to 8 of 8

Problem with set scroll area in VBA

  1. #1
    Registered User
    Join Date
    01-16-2013
    Location
    Alaska
    MS-Off Ver
    Excel 2007
    Posts
    54

    Problem with set scroll area in VBA

    Hello All,

    My question is how to lock the scroll area in VBA as every time I lock the scroll area it does not save. The first sheet, (sheet1) I would like to limit scroll area to “A1:LC53” the second sheet would be (Construction Home) and I would like to limit scroll area to “A1:S43”

    Here is the code I have been working with
    Please Login or Register  to view this content.

    I have been saving this in each sheet i.e. the sheet1 would be saved in sheet1 and construction Home would be saved in the Construction Home, is the the proper way or do they need to be in the "this work book"?


    Any and All Help would be much appreciated and Thanks in Advanced , Jeff
    Last edited by Jeff up North; 02-22-2013 at 01:56 PM. Reason: Code tags not quote tags.

  2. #2
    Forum Contributor
    Join Date
    12-31-2012
    Location
    Jhang, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: Problem with set scroll area in VBA

    It should be in ThisWorkBook Module.

  3. #3
    Registered User
    Join Date
    01-16-2013
    Location
    Alaska
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: Problem with set scroll area in VBA

    Hafizimran,

    Thanks for the quick reply, I have tried it in "thisworkbook" but it still would not work so I figured the colde was a liitle off. Any idea on the code?

    Jeff

  4. #4
    Forum Contributor
    Join Date
    12-31-2012
    Location
    Jhang, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: Problem with set scroll area in VBA

    Code is correct and it must work. Have you enabled macros? If yes then can you upload your workbook please?

  5. #5
    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: Problem with set scroll area in VBA

    The code is fine. You need to save, close, and reopen the workbook.
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Registered User
    Join Date
    01-16-2013
    Location
    Alaska
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: Problem with set scroll area in VBA

    I have attached the work book as when I save it under this work book it comes back as a err. under Private Sub Workbook_Open() not sure if it has to do with the first code I have in the This work book?

    Master 022213.xlsm

    Thank you all for the quick replies, Jeff

  7. #7
    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: Problem with set scroll area in VBA

    You can only have one Workbook_Open procedure. Put all the code in one or the other.

  8. #8
    Registered User
    Join Date
    01-16-2013
    Location
    Alaska
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: Problem with set scroll area in VBA

    Shg,

    that solved the problem, SHG thanks for helping out, I have added to both of your reputaions and will mark this solved, Thanks again Jeff

+ 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