Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. copying and pasting controls and the associated code

copying and pasting controls and the associated code

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestiondiscussion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chris Hooper
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups