loop items in cpombobox from the clicked to the top of list

User avatar
sal21
PlatinumLounger
Posts: 4357
Joined: 26 Apr 2010, 17:36

loop items in cpombobox from the clicked to the top of list

Post by sal21 »

I need to loop items of combobox from the clicked item to the top of list...
example in combobox1:
30/09/2011
29/09/2011
28/09/2011
27/09/2011
26/09/2011
23/09/2011
22/09/2011
21/09/2011
20/09/2011
19/09/2011
16/09/2011
15/09/2011
14/09/2011
13/09/2011
12/09/2011
...
09/09/2011

if i click on item 27/09/2011 and after loop i need:

28/09/2011
29/09/2011
30/09/2011

User avatar
djlansing
NewLounger
Posts: 12
Joined: 08 Feb 2010, 17:19
Location: Rotterdam, NY

Re: loop items in cpombobox from the clicked to the top of l

Post by djlansing »

try this
For indx = Me.YourComboboxName.ListIndex To 0 Step -1
Debug.Print Me.YourComboboxName.Column(1, indx) ' Your code here
Next indx
djlansing (Life is expensive, however it does include a free trip around the sun.)


User avatar
HansV
Administrator
Posts: 78512
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: loop items in cpombobox from the clicked to the top of l

Post by HansV »

Sal, did djlansing's reply solve your problem?
Best wishes,
Hans