+ Reply to Thread
Results 1 to 2 of 2

dynamic creation of CheckBox1_Click() sub

  1. #1
    Registered User
    Join Date
    05-07-2014
    Location
    Prescott, AZ
    MS-Off Ver
    Excel 2007
    Posts
    35

    dynamic creation of CheckBox1_Click() sub

    I need to dynamically create a sub for CB's 1 to ??. I have a sub to create the boxes, I want to make a click sub for each box to call a handler with reference to the cell position the check box is in.

    I know I have read a similar solution, but after searching for longer than is practical, I'll ask what's the magic words to create a sub.

    Please Login or Register  to view this content.
    Thanks in advance.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: dynamic creation of CheckBox1_Click() sub

    Do a web search for something like Excel VBA Extensibility to find links to programmatically add code.
    Here's one good reference Programming The VBA Editor

    Alternatively, if you create Forms-type checkboxes instead of ActiveX-type checkboxes, you could assign one procedure to all the checkboxes. The procedure could use the Application.Caller method to determine which checkbox called the procedure and from there determine the cell range...etc.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Dynamic Box Creation
    By Tayjayt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-10-2013, 04:03 AM
  2. Dynamic URL creation
    By atheo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-23-2010, 11:50 PM
  3. Dynamic Macro creation
    By namz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-24-2010, 01:28 AM
  4. Dynamic Range Creation
    By dgtvr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-30-2008, 08:43 AM
  5. Dynamic Row Creation
    By mwagon73 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-22-2007, 12:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1