+ Reply to Thread
Results 1 to 3 of 3

ActiveWindow.ScrollRow and ScrollColumn

  1. #1
    David Welch
    Guest

    ActiveWindow.ScrollRow and ScrollColumn

    Hi,

    I am attempting to use the ScrollRow and ScrollColumn properties of the
    ActiveWindow. My problem is when a user clicks on an item in a list box
    I want the activewindow to scroll to the relevant range for that item so
    that the user doesn't have to do it herself, ie

    ActiveWindow.ScrollRow = SourceRange.Row
    ActiveWindow.ScrollColumn = SourceRange.Column

    Unfortunatly both the scrollrow and scrollcolumn props don't work and
    neither does the ActiveWindow.ScrollIntoView. I have also tried the
    Range.Show method.

    I have set the modal property of the form to false, and so I can move
    around the window manually. All that happens when ScrollRow etc is used
    seems to be that the selection the was present when the form first
    started comes into view.

    I have tried to set selection programmatically first but this doesn't
    work either.

    Thanks for any help.

    ---
    Dave

  2. #2
    FSt1
    Guest

    RE: ActiveWindow.ScrollRow and ScrollColumn

    hi,
    if all that is not working, might i suggest that you use find instead. that
    would take the user to the item.
    here is code i wrote for a combo box and just adapted it to a list box.
    it works on xl2k.

    Private Sub ListBox2_Click()
    Dim c As String
    Dim Rng As Range
    c = Me.ListBox2.Value
    If c = "" Then Exit Sub
    Set Rng = Range("A1:AC500").Find(What:=c, _
    After:=Range("A1"), _
    LookIn:=xlValues, _
    LookAt:=xlWhole, _
    SearchOrder:=xlByRows, _
    SearchDirection:=xlNext, _
    MatchCase:=False)
    Rng.Select
    End Sub

    Regards

    FSt1
    "David Welch" wrote:

    > Hi,
    >
    > I am attempting to use the ScrollRow and ScrollColumn properties of the
    > ActiveWindow. My problem is when a user clicks on an item in a list box
    > I want the activewindow to scroll to the relevant range for that item so
    > that the user doesn't have to do it herself, ie
    >
    > ActiveWindow.ScrollRow = SourceRange.Row
    > ActiveWindow.ScrollColumn = SourceRange.Column
    >
    > Unfortunatly both the scrollrow and scrollcolumn props don't work and
    > neither does the ActiveWindow.ScrollIntoView. I have also tried the
    > Range.Show method.
    >
    > I have set the modal property of the form to false, and so I can move
    > around the window manually. All that happens when ScrollRow etc is used
    > seems to be that the selection the was present when the form first
    > started comes into view.
    >
    > I have tried to set selection programmatically first but this doesn't
    > work either.
    >
    > Thanks for any help.
    >
    > ---
    > Dave
    >


  3. #3
    David Welch
    Guest

    Re: ActiveWindow.ScrollRow and ScrollColumn

    Oops, my problem was I was getting the wrong range to show!

    Now doing show on the right range goes to the correct place, but thanks
    anyway.


    FSt1 wrote:
    > hi,
    > if all that is not working, might i suggest that you use find instead. that
    > would take the user to the item.
    > here is code i wrote for a combo box and just adapted it to a list box.
    > it works on xl2k.
    >
    > Private Sub ListBox2_Click()
    > Dim c As String
    > Dim Rng As Range
    > c = Me.ListBox2.Value
    > If c = "" Then Exit Sub
    > Set Rng = Range("A1:AC500").Find(What:=c, _
    > After:=Range("A1"), _
    > LookIn:=xlValues, _
    > LookAt:=xlWhole, _
    > SearchOrder:=xlByRows, _
    > SearchDirection:=xlNext, _
    > MatchCase:=False)
    > Rng.Select
    > End Sub
    >
    > Regards
    >
    > FSt1
    > "David Welch" wrote:
    >
    >
    >>Hi,
    >>
    >>I am attempting to use the ScrollRow and ScrollColumn properties of the
    >>ActiveWindow. My problem is when a user clicks on an item in a list box
    >>I want the activewindow to scroll to the relevant range for that item so
    >>that the user doesn't have to do it herself, ie
    >>
    >> ActiveWindow.ScrollRow = SourceRange.Row
    >> ActiveWindow.ScrollColumn = SourceRange.Column
    >>
    >>Unfortunatly both the scrollrow and scrollcolumn props don't work and
    >>neither does the ActiveWindow.ScrollIntoView. I have also tried the
    >>Range.Show method.
    >>
    >>I have set the modal property of the form to false, and so I can move
    >>around the window manually. All that happens when ScrollRow etc is used
    >>seems to be that the selection the was present when the form first
    >>started comes into view.
    >>
    >>I have tried to set selection programmatically first but this doesn't
    >>work either.
    >>
    >>Thanks for any help.
    >>
    >>---
    >>Dave
    >>


+ 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