ActiveWindow.ScrollRow and ScrollColumn

  • Thread starter Thread starter David Welch
  • Start date Start date
D

David Welch

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.
 
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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top