Prevent ActiveX Combobox change value when selecting list

akaseto

New Member
Joined
Oct 10, 2021
Messages
13
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!
 

akaseto

New Member
Joined
Oct 10, 2021
Messages
13
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
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
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Akuini

Well-known Member
Joined
Feb 1, 2016
Messages
3,653
Office Version
  1. 365
Platform
  1. Windows
You're welcome, glad to help & thanks for the feedback.:)
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,127
Messages
5,768,275
Members
425,460
Latest member
Astros1243

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
Top