Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ActiveWindow.SelectedSheets.PrintOut | Excel Programming | |||
Help with ScrollRow | Excel Programming | |||
ScrollRow | Excel Programming | |||
ActiveWindow.ScrollColumn Sort | Excel Programming | |||
Using ActiveWindow.PointsToScreenPixelsY | Excel Programming |