Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default loop through Combobox

Whenever I goto the end of my Combobox (last listnumber) with my Keys, I want the control to goto listindex -1. In another way when I tab into a ComboBox and use my keys to go through the values, I want the control to start all over whenever I reach the last value

Another control I could use is whenever I use my mouse to go through the values, I want the top value to change with the (with mouse) highlighted value
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default loop through Combobox

Add this code to your userform

Private Sub ComboBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
With Me.ComboBox1
Select Case KeyCode
Case 40 ' : 'down arrow
If .ListIndex = .ListCount - 1 Then
.ListIndex = -1
End If
End Select
End With
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"akyhne" wrote in message
...
Whenever I goto the end of my Combobox (last listnumber) with my Keys, I

want the control to goto listindex -1. In another way when I tab into a
ComboBox and use my keys to go through the values, I want the control to
start all over whenever I reach the last value.

Another control I could use is whenever I use my mouse to go through the

values, I want the top value to change with the (with mouse) highlighted
value


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
Find loop doesn't loop JSnow Excel Discussion (Misc queries) 2 June 24th 09 08:28 PM
fill combobox depending on selection from another combobox Adam Francis Excel Discussion (Misc queries) 2 July 24th 08 07:39 PM
COMBOBOX smiley New Users to Excel 1 October 12th 05 02:01 PM
Worksheet_Change - loop within a loop bgm Excel Programming 1 January 19th 04 01:27 PM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM


All times are GMT +1. The time now is 06:50 PM.

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

About Us

"It's about Microsoft Excel"