copying and pasting controls and the associated code
-
I am fairly new to VB programming so I don't know if the following is possible and I would appreciate some thoughts. I have written a combo box control for Excel which allows the user to select rows of data in a different sheet and have the pasted into the one containing the control. My next objective is to create buttons controls to introduce these combo box controls to the spread sheet sequentially. So for example, if you pressed button 1 a copy of combobox1 would appear in the worksheet. If you then pressed button 2 a copy of combobox2 would appear following. My problem with copying and pasting so far is that the code associated with the comboboxes is not copied along with the GUI of the control. Is it possible to produce multiple instances of the same control, utilising the same code but have them seperated so that they can all perform their functions independently, on different parts of the worksheet. The user must be able to select the number and order of the combobox controls within the worksheet. I thought of producing a macro which copied the code within the visual basic window but this would lead to conflicts since every instance of the combobox control would share the same identifier (eg. combobox1). Would this mean that each instance of the control would be trying to work on the same data? Any thoughts would be appreciated. Many thanks, Chris.