Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have 16 comboboxes on an excel sheet. When a change takes place, i want
some function to trigger. is there any way to write a generic function as an event of 'change'. is there any way to identify the calling control? thanks MVM |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There is no easy way around it: the comboboxes will only trigger their own
_change event, so they will all need their own event procedure to be detected. If you needed to do this on a bigger scale, or planned to design more workbooks with a similar feature, you could define a custom class with its own events; but that would be a lot of work. I have found the easiest way is to make a simple and easily copied and modified event procedure to run and immediately call a "master" subroutine: 1) for the first combobox, write an event procedure like this: Sub ComboBox1_Change() Call ComboMain(1) End Sub 2) Now copy this and paste the copy 15 times. Go to each, highlight it, and do a Find/Replace (Ctrl H) to change 1 to 2, or 3, or 4, or 5, ... and so on for each; e.g. the final one will look like this: Sub ComboBox16_Change() Call ComboMain(16) End Sub 3) Now to tie it all together: Sub ComboMain(CBNumber as Integer) 'CBNumber tells you which combobox was changed, so now do whatever you need to do here End Sub It is not too bad to set up this way, and I think it can do what you want. -- - K Dales "MVM" wrote: I have 16 comboboxes on an excel sheet. When a change takes place, i want some function to trigger. is there any way to write a generic function as an event of 'change'. is there any way to identify the calling control? thanks MVM |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
fill combobox depending on selection from another combobox | Excel Discussion (Misc queries) | |||
How Do I Load A ComboBox RowSource From The Results Of Another ComboBox | Excel Programming | |||
Populating combobox from another combobox | Excel Programming | |||
Combobox Value | Excel Programming | |||
combobox value | Excel Programming |