Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveWindow.SelectedSheets.PrintOut excel-lent Excel Programming 4 June 15th 05 03:48 PM
Help with ScrollRow Glen Mettler[_4_] Excel Programming 0 November 18th 04 01:24 PM
ScrollRow Glen Mettler[_4_] Excel Programming 0 November 17th 04 03:04 PM
ActiveWindow.ScrollColumn Sort hotherps[_102_] Excel Programming 1 August 13th 04 02:27 PM
Using ActiveWindow.PointsToScreenPixelsY Pancho Excel Programming 5 February 7th 04 11:23 PM


All times are GMT +1. The time now is 05:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"