Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello!
I generate comboboxes dynamically in my code. Now I also want to manipulate the approbriate Change-functions of these elements. Is this possible and how? For example, I insert a new comobox and name it "my_box". Now I want to manipulate the function "my_box_Change" by my code. Thanks for your answers! Regards Christian Galbavy |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Christian,
Assuming a control toolbox combobox, here is an example of adding its click event With ThisWorkbook.VBProject.VBComponents(Worksheets("Sh eet2").CodeName).CodeModul e .InsertLines .CreateEventProc("Click", "ComboBox1") + 1, _ vbTab & "If Range(""A1"").Value 0 Then " & vbCrLf & _ vbTab & vbTab & "Msgbox ""Hi""" & vbCrLf & _ vbTab & "End If" End With which will add this code Private Sub ComboBox1_Click() If Range("A1").Value 0 Then MsgBox "Hi" End If End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Christian Galbavy" wrote in message ... Hello! I generate comboboxes dynamically in my code. Now I also want to manipulate the approbriate Change-functions of these elements. Is this possible and how? For example, I insert a new comobox and name it "my_box". Now I want to manipulate the function "my_box_Change" by my code. Thanks for your answers! Regards Christian Galbavy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is It Possible To Dynamically Name Series? | Charts and Charting in Excel | |||
Generate a formula dynamically ? | Excel Worksheet Functions | |||
Getting handle to Row # dynamically | Excel Discussion (Misc queries) | |||
generate a random number and use if function to generate new data | Excel Worksheet Functions | |||
add controls on the fly/dynamically | Excel Discussion (Misc queries) |