Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macros combo box excel

Status
Not open for further replies.

crossface

Programmer
Nov 30, 2002
81
US
I am trying to record a macro where the user goes from one combo box to the next. How do I reference the combox I want to go to. Clicking on it with a mouse does not work, nothing gets recorded.

 
I am not sure but you might be able to put code in the after update of the current combo, to move cursor to the next combo... does that sound right?

misscrf

Management is doing things right, leadership is doing the right things
 
Hi crossface,

What you probably want is something like this in your sheet's code module ..

Code:
[blue]Private Sub ComboBox1_Change()
    Me.ComboBox2.Activate
End Sub
Private Sub ComboBox2_Change()
    Me.ComboBox1.Activate
End Sub
[/blue]

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at [url=http://www.vbaexpress.
 
How ar the combo boxes named. I just made them from the froms tool bar. I do not see where they are identified by a name.

Kevin Cotter
Byron Schools
 
Hi Kevin,

Let me say up front that I don't know how to do this. I'll tell you what I do know in case it is of any help.

ActiveX Comboboxes added from the Control Toolbox have events and you can code them as per my previous post, using the appropriately named procedures in the Sheet's code module. As you said combo box, I assumed this was what you had.

Dropdowns from the Forms Toolbar behave differently. They don't have events but you can assign a macro to them which is run when they are changed. This macro goes in a standard code module and can be called anything you want. The connection between the dropdown and the macro is made via the Assign Macro option in the right click menu on the dropdown.

You can't 'activate' a Forms Toolbar Dropdown. You can 'select' it in an unprotected sheet, but that is for design, and isn't what you want.

I'm afraid I don't have any idea even whether it is possible to shift the focus to a forms toolbar control in code, never mind how. I will have to defer to someone else. Sorry.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at [url=http://www.vbaexpress.
 
I think this is what I needed to know. I have to use the Active X Combo Box

I have not used them before

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top