Executing a code block when a combobox MatchEntry complete highlighted selection is clicked...

chazrab

Well-known Member
Joined
Oct 21, 2006
Messages
884
Office Version
  1. 365
Platform
  1. Windows
Combobox1’s MatchEntry complete property quickly finds a matching value in the dropdown list and highlights the found selection in blue. So far so good.
But when I click the matched entry blue highlighted selection nothing happens.
What I WANT to have happen is what DOES happen when I press the ENTER key on the keyboard which immediately runs this code:

/code
Private Sub ComboBox1_KeyDown(ByVal _
KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
Application.EnableEvents = True
Select Case KeyCode
Case 13 'Enter pressing enter on the keyboard runs the code between the select end select below:
ActiveCell.Offset(0, 5).value = "0.00"
ActiveCell.Offset(0, 1).value = _
WorksheetFunction.Index(Sheets("MYLIST").Range("MYRANGE"), _
ComboBox1.ListIndex + 1, 2) 'puts selected description value and corrsponding value category in Combobox1 on activecell row in A and B

Select case is = run this
Select case is = run this
End select
End select
/
Code:
Point: I want to get around having to press the ENTER key on the keyboard and immediately have the code between select and end select block run when the MatchEntry selection is clicked. How can I do this ?
(putting the code in the combobox Click event doesn't not work the way I am asking it to by just clicking the selected value)

Thanks for anyone’s help.  Seems possible to achieve. 
cr
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,214,823
Messages
6,121,779
Members
449,049
Latest member
greyangel23

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