Unselect current combo box macro

satheo

New Member
Joined
Jun 10, 2014
Messages
34
I have a sheet with quite a few activeX combo boxes that users select stuff from, then an export macro bound to a hotkey. The issue is that if you try to use the export macro while you still have a combo box selected it doesn't run and puts some strange characters in the box over what was in there before. Yeah users can just click somewhere else and run it but I'd like to make it as fool-proof as possible.

I don't know much about VBA, the export macro is a module, do I need to put some sort of call to it in the workbook objects or something?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Others may have a much better solution. Just as an idea:

VBA Code:
Private Sub ComboBox1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)

    'Debug.Print Shift, KeyCode
    
    If Shift = 3 And KeyCode = Asc("K") Then
        Debug.Print "ok"
        Call Module1.test_Combobox
    End If

End Sub

Where macro is bound to shortcut CTRL + SHIFT + K.

Shift Values: SHIFT (1), CTRL (2), ALT (4)
 
Upvote 0
Solution

Forum statistics

Threads
1,214,814
Messages
6,121,711
Members
449,049
Latest member
THMarana

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