Prevent ActiveX Combobox change value when selecting list

akaseto

New Member
Joined
Oct 10, 2021
Messages
18
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
hi,
im using combobox to make a region search engine based on this tutorial : Create an Excel Drop Down Search
with some modifications i want to use down arrow to select item from the list but the problem is when i pressed down to list, combobox automaticaly value updated to the 1st suggestions.
sample :
Annotation 2021-10-11 044121.jpg
>
Annotation 2021-10-11 044109.jpg


how to make/select 2nd suggestions with arrow keys without updating combobox value ? so, combobox list wont change.
this is my code :
Code:
Private Sub Desa_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
    Select Case KeyCode
        Case 13
            Dim rRng As Range, c As Range
            Kec.Clear
            Set rRng = ActiveSheet.Range("C32:C36")
                If Cells(32, 2) <> "" Then
                    With rRng
                        For Each c In .Columns(1).Cells
                            If c.Value <> "" Then
                                Kec.AddItem c.Value
                            End If
                        Next c
                    End With
                Else
                    Exit Sub
                End If
            Kec.Activate
        Case Else
            Desa.ListFillRange = "DropDownList"
            Me.Desa.DropDown
        End Select
End Sub

please help!
 
Where do you put the code? in sheet1 module?
and "nama.Activate" is nama in the same sheet?
nama is another textbox in the same sheet
It's rather hard to guess without a a sample file.
Could you upload a sample workbook (without sensitive data) to a sharing site like dropbox.com or google drive?
already solved, many thanks ! i just put linked cell into combobox properties insead using Range(xCell) = .Value
 
Upvote 0

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
You're welcome, glad to help & thanks for the feedback.:)
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,140
Members
448,551
Latest member
Sienna de Souza

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top