Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Tom,
Didn't think of this method. This makes sense. Thanks for your help. Regards Sadik -----Original Message----- Assuming the Comboboxes are on a userform. For methods that belong to the combobox, you can. However, the exit event belongs to the control object and for that you can't. You can write single routine which is called from the exit event of each combobox, so that would reduce you burden somewhat. Private Sub C1_Exit() ExitCode C1 End Sub Sub ExitCode(cbx as MSForms.Combobox) dim cbx1 as MSForms.Combobox dim ctl as Control for each ctl in Userform1.Controls if typeof ctl is MSForms.Combobox then set cbx1 = ctl if cbx1.Name < cbx.Name then cbx1.Enabled = False end if end if Next End Sub -- Regards, Tom Ogilvy wrote in message ... Hio All, I have a few ComboBoxes on a userform e.g. C1, C2 C3 etc. I want to put the same procedure for all of them which would be trigered on exitiing the relevant ComboBox. The codes would include the following line, say exiting C1: C2.enabled = false C3.enabled = false My two questions a 1. Can I write a single (I ahve quite a few Combos) procedure that will perform on exiting any combo on the userform and how? 2. Can the above code be included? Thanks for your help in advance. Regards . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
fill combobox depending on selection from another combobox | Excel Discussion (Misc queries) | |||
Exit Sub | Excel Discussion (Misc queries) | |||
Run when exit | Excel Worksheet Functions | |||
combobox exit event | Excel Programming | |||
If a called sub exit, how to the caller exit right away? | Excel Programming |