View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Curly Question with a Combobox

If multiselect is false, and the user selects the item, then it is
highlighted/selected and the Value of the combobox will hold that value.

If you want to react to where the mouse is hovering, you will have to take
cognizance of what is displayed in the list, and where the mouse is in
proportion to the height of the box and the number of items in the list and
manuever the sheet by calculating what item the mouse is over (would be my
guess - and it would only be approximate, but if you are just "centering"
the visible range, then that should be close enough).

--
Regards,
Tom Ogilvy


"Corey" wrote in message
...
I tried and pasted the below code into the MOUSEMOVE event,
I get the WorkSheet flickering but it does not scroll up or down at all??

Private Sub ComboBox3_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single,
ByVal Y As Single)
On Error Resume Next
With Worksheets("InspectionData").Range("A:A")
Set rngFound = .Find(What:=Me.ComboBox3.Value, After:=.Range("A1"),
LookIn:=xlValues,
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False, Matchbyte:=False)
rngFound.Offset(25, 0).Activate
End With
With ActiveWindow
.ScrollRow = ActiveCell.Row - Int(.VisibleRange.Rows.Count / 2)
.ScrollColumn = ActiveCell.Column - Int((.VisibleRange.Columns.Count - 1)
/ 2)
End With
On Error GoTo 0
Application.ScreenUpdating = True
End Sub


Can i replace the 'Me.Combobox3.Value' with a
Me.Combobox3.SelectionHighlighted or similar ?


Corey....
"Corey" wrote in message
...
If i set Application.ScreenUpdating = True,
when the user triggers the Combobox1 DropButtonClick_Event ( ),
the userform that displays the Combobox stays in the centre of the screen
and the page that contains
the values listed in the Combobox appears in the back ground.
With me so far?

Now, the values of the Combobox.List are in Column A which can be seen in
the background worksheet
once the DropButtonClick event is triggered.

Here is the Question :

If I place my MOUSE over a value in the list, Can the WorkSheet in the
background scroll Up/Down to
Centre the Value or set the value to the top of the page?


I have values i need to LOOK at that are in Column C 2-22 rows below the
value in Column A.

Is this possible?
What does the Mouse Up, Mouse Down, Mouse Move event's do, is this it???


How can i code this if that is the case ??

Corey....