+ Reply to Thread
Results 1 to 6 of 6

Boundaries Excel Worksheet

  1. #1
    Registered User
    Join Date
    03-26-2005
    Location
    Haarlem, the Netherlands
    MS-Off Ver
    Excel 2003, SP3
    Posts
    13

    Boundaries Excel Worksheet

    Dear all, in one of my applications I would like to physically limit the number of rows and columns. So, the user cannot navigate beyond - say - 20 rows and 10 columns. Any way to do this in VBA? Thanks!

  2. #2
    Rick Hansen
    Guest

    Re: Boundaries Excel Worksheet

    Kees, Try this.

    Worksheets("Sheet1").ScrollArea = "A1:J20"

    this will lock the worksheet at 20 rows, and 10 Columns.

    enjoy, Rick


    "Kees Korver" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Dear all, in one of my applications I would like to physically limit the
    > number of rows and columns. So, the user cannot navigate beyond - say -
    > 20 rows and 10 columns. Any way to do this in VBA? Thanks!
    >
    >
    > --
    > Kees Korver
    > ------------------------------------------------------------------------
    > Kees Korver's Profile:

    http://www.excelforum.com/member.php...o&userid=21562
    > View this thread: http://www.excelforum.com/showthread...hreadid=532165
    >




  3. #3
    NickHK
    Guest

    Re: Boundaries Excel Worksheet

    Kees,
    As Rick pointed out, it's .ScrollArea.
    But this is not a persistent setting (in Office 2K anyway), so you have to
    set it each time the WB is opened.

    NickHK

    "Kees Korver" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Dear all, in one of my applications I would like to physically limit the
    > number of rows and columns. So, the user cannot navigate beyond - say -
    > 20 rows and 10 columns. Any way to do this in VBA? Thanks!
    >
    >
    > --
    > Kees Korver
    > ------------------------------------------------------------------------
    > Kees Korver's Profile:

    http://www.excelforum.com/member.php...o&userid=21562
    > View this thread: http://www.excelforum.com/showthread...hreadid=532165
    >




  4. #4
    Registered User
    Join Date
    03-26-2005
    Location
    Haarlem, the Netherlands
    MS-Off Ver
    Excel 2003, SP3
    Posts
    13
    Nick (or others), how can I accomplish this automatically? If I open a Workbook, can I force Excel to run a macro immediately? e.g. with Workbook_Open command somewhere?
    Just make a macro in VBA-editor with the name Workbook_Open()?
    (I tried this, but Excel doesn't seem to detect this)
    Thanks!
    Kees

    [QUOTE=NickHK]Kees,
    As Rick pointed out, it's .ScrollArea.
    But this is not a persistent setting (in Office 2K anyway), so you have to
    set it each time the WB is opened.

    NickHK

  5. #5
    Rick Hansen
    Guest

    Re: Boundaries Excel Worksheet

    Kees, here is the procedure to insert your code Workbook_Open().

    First goto the VB Editor, now from VBA Project Explore window right
    click on "ThisWorkbook", now click on "view code". Now on the left side
    above the edit window click on the drop list and select "Workbook", now
    from the right side drop down click and select the event. In your case
    select "Open". Now VBE will place skeleton structure of Workbook_Open()
    sub into the edit window. Now add the code to this sub ie...

    Private Sub Workbook_Open()

    Worksheets("Sheet1").ScrollArea = "A1:J20"

    End Sub

    enjoy, Rick



    "Kees Korver" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Nick (or others), how can I accomplish this automatically? If I open a
    > Workbook, can I force Excel to run a macro immediately? e.g. with
    > Workbook_Open command somewhere?
    > Just make a macro in VBA-editor with the name Workbook_Open()?
    > (I tried this, but Excel doesn't seem to detect this)
    > Thanks!
    > Kees
    >
    > NickHK Wrote:
    > > Kees,
    > > As Rick pointed out, it's .ScrollArea.
    > > But this is not a persistent setting (in Office 2K anyway), so you have
    > > to
    > > set it each time the WB is opened.
    > >
    > > NickHK

    >
    >
    > --
    > Kees Korver
    > ------------------------------------------------------------------------
    > Kees Korver's Profile:

    http://www.excelforum.com/member.php...o&userid=21562
    > View this thread: http://www.excelforum.com/showthread...hreadid=532165
    >




  6. #6
    Registered User
    Join Date
    03-26-2005
    Location
    Haarlem, the Netherlands
    MS-Off Ver
    Excel 2003, SP3
    Posts
    13
    Rick, all works fine! Thank you for your attention and time! Kees

    [QUOTE=Rick Hansen]Kees, here is the procedure to insert your code Workbook_Open().

    First goto the VB Editor, now from VBA Project Explore window right
    click on "ThisWorkbook", now click on "view code". Now on the left side
    above the edit window click on the drop list and select "Workbook", now
    from the right side drop down click and select the event. In your case
    select "Open". Now VBE will place skeleton structure of Workbook_Open()
    sub into the edit window. Now add the code to this sub ie...

    Private Sub Workbook_Open()

    Worksheets("Sheet1").ScrollArea = "A1:J20"

    End Sub

    enjoy, Rick

+ 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