98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » ComboBox Select
ComboBox Select
Resolved · High Priority · Version 2003
Ziggy has attended:
Excel VBA Intro Intermediate course
Excel VBA Advanced course
ComboBox Select
Hello
Very quick one (I think) but cant find a sensible answer anywhere.
I have an embedded combobox, after I run a reset procedure I would like the combobox field to be active so that I may use the arrow keys to navigate.
Currently I have to click in the box (not a HUGE problem but not tidy). (I also have a similar problem with another set of comboboxes, where after selecting in one I would like the second to be active in the fashion described above.)
Sheets("Name").cboName.Select
Selects the combobox as if editing.
Sheets("Name").cboName.Dropdown
Opens the dropdown (which is even worse).
I just wish for the cursor to be "flashing" in the box.
Any help would be great.
Many thanks
Ziggy
RE: ComboBox Select
Hi Ziggy, thanks for your query. Select the Combobox on the form and in the properties panel set its TabIndex value to 0. When the form is run the cursor should be flashing in the ComboxBox. Note you can also access the TabIndex property in code.
Hope this helps,
Anthony
RE: ComboBox Select
Hello Anthony
Thank you for such a swift reply.
However, as I think I mentioned in the original message the combobox is embedded (i.e. in a sheet).
It is created with the whole sheet when a button is clicked. It is at the end of this process that I would like the cursor to be in the combobox. (so basically the line of code that would do the action described in your reply.... see original message for the things I have already tried).
Many thanks
Ziggy
RE: ComboBox Select
Hi Ziggy. Try:
Sheets("Sheet1").ComboBox1.Activate
Hope this helps,
Anthony
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Line breaks in a cellYou can control the line breaks for multiple-line headings or labels in your Microsoft Excel worksheet, just like you do in Microsoft Word. Here's how to do it. |