+ Reply to Thread
Results 1 to 9 of 9

Assign a function key to combobox

  1. #1
    Forum Contributor
    Join Date
    05-16-2012
    Location
    Latina, ITALY
    MS-Off Ver
    Excel 2010--2016
    Posts
    947

    Assign a function key to combobox

    Good evening in the attached file I have 3 comboboxes and I would like to move from one combobox to another via F1, F2, F3.

    I have inserted in the form of the sheet:
    Please Login or Register  to view this content.

    in the standard form:

    Please Login or Register  to view this content.

    but it does not work.
    can you tell me what's missing?
    Thank you.
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,851

    Re: Assign a function key to combobox

    Quote Originally Posted by Berna11 View Post
    it does not work.
    Please explain what "doesn't work" means.
    • Does the code run?
    • Does it run but do nothing?
    • Does it produce error messages? If so, what do the messages say?
    • Does it produce unexpected/wrong results? If so, how do the results differ from what you expect?
    • Does it hang?

    SetFocus in not available for ActiveX comboxes in a worksheet, only in a UserForm. If you use Select, it will Select the combobox.

    I am a little unclear as to how you want to use this. If you make a combobox active you still have to click and scroll to select an item. It is just as easy to click on the combobox--a single click will select the combobox and display the dropdown list.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    05-16-2012
    Location
    Latina, ITALY
    MS-Off Ver
    Excel 2010--2016
    Posts
    947

    Re: Assign a function key to combobox

    Thanks for the reply
    gives me the run-time error 424
    Object required.

    I need to use only the keyboard and not the mouse if possible

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,851

    Re: Assign a function key to combobox

    You have to update your code to qualify the reference to the combobox.

    Please Login or Register  to view this content.
    Once it is selected, I don't know if you can activate the dropdown with a keystroke.

  5. #5
    Forum Contributor
    Join Date
    05-16-2012
    Location
    Latina, ITALY
    MS-Off Ver
    Excel 2010--2016
    Posts
    947

    Re: Assign a function key to combobox

    Modifying the code as indicated goes to Excel block.

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,851

    Re: Assign a function key to combobox

    What do you mean by "Excel block"?

  7. #7
    Forum Contributor
    Join Date
    05-16-2012
    Location
    Latina, ITALY
    MS-Off Ver
    Excel 2010--2016
    Posts
    947

    Re: Assign a function key to combobox

    Good morning
    "Excel block"?
    excel crashes

    I'll send you the file you can try.
    Thank you
    Attached Files Attached Files

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,851

    Re: Assign a function key to combobox

    It does not crash for me. It selects the desired combobox.

    I tried using Activate instead of Select. It allows you to scroll through the combobox selections with up arrow/down arrow, although the dropdown list does not actually drop down. That may meet your requirements.

  9. #9
    Forum Contributor
    Join Date
    05-16-2012
    Location
    Latina, ITALY
    MS-Off Ver
    Excel 2010--2016
    Posts
    947

    Re: Assign a function key to combobox

    With Activate it goes better Exxcel does not crash

    there is this problem:
    If the cursor is on any cell, pressing F1-F2-F3,
    * the focus goes on the correct combobox, however, if I find the example cursor in combobox1 and press F2 I would like to switch to the combobox2 it does not move.

    Can anything be done?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to assign list name in ActiveX Combobox
    By Sanjibghosh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-10-2016, 09:13 AM
  2. [SOLVED] How to assign list to a comboBox without Vba
    By HerryMarkowitz in forum Excel General
    Replies: 2
    Last Post: 09-04-2015, 02:29 AM
  3. Macro assign to ActiveX Combobox
    By kangsongwu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-19-2014, 02:56 AM
  4. assign value to Combobox
    By kangsongwu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-17-2014, 11:23 AM
  5. [SOLVED] Assign Change event to generic ComboBox
    By pjcbm9 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-20-2014, 12:18 PM
  6. Replies: 1
    Last Post: 03-30-2014, 08:54 PM
  7. Add new combobox to userfrom and assign an event which opens another new combobox
    By gr3gor13 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2014, 11:07 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1