+ Reply to Thread
Results 1 to 4 of 4

Add codes for dynamically created Active x-check boxes using vba

  1. #1
    Registered User
    Join Date
    01-24-2017
    Location
    Chennai,India
    MS-Off Ver
    2013
    Posts
    3

    Add codes for dynamically created Active x-check boxes using vba

    Please Login or Register  to view this content.

    This Code will help me to create many active-x check boxes as per my requirement, I need to know how to add codes to these check boxes.every check boxes will have similar codes.
    for example, a row will be mapped to these check boxes respectively. these check boxes will be checked and a command button will be clicked, which will copy the rows of selected check boxes to another sheet.
    if possible i can create separate names for each check box while creating it nd add codes accordingly.
    Is there any way?

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Add codes for dynamically created Active x-check boxes using vba

    Hi sujin and welcome to ExcelForum,

    Thank you for using Code Tags.

    The attached file and code associated with post #2 in the following thread may help you: http://www.excelforum.com/showthread.php?t=1027267

    Lewis

  3. #3
    Registered User
    Join Date
    01-24-2017
    Location
    Chennai,India
    MS-Off Ver
    2013
    Posts
    3

    Re: Add codes for dynamically created Active x-check boxes using vba

    Quote Originally Posted by LJMetzger View Post
    Hi sujin and welcome to ExcelForum,

    Thank you for using Code Tags.

    The attached file and code associated with post #2 in the following thread may help you: http://www.excelforum.com/showthread.php?t=1027267

    Lewis
    nfr.png

    in this image the check boxes will be created dynamically.
    if i click the necessary check box,and the command button "export the nfr", the row corresponding to the selected check box should be copied to another sheet, is there any way to add codes for that manipulation
    Last edited by sujin; 02-01-2017 at 03:00 AM.

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Add codes for dynamically created Active x-check boxes using vba

    Hi sujin,

    In the future, please upload a sample workbook. That way the responder does not have to reproduce your data, and you will probably get more accurate and faster responses.

    if i click the necessary check box,and the command button "export the nfr", the row corresponding to the selected check box should be copied to another sheet, is there any way to add codes for that manipulation
    Your question has a few issues:
    a. Because you use 'Merged Cells' in Columns 'B' and 'C', the destination area will not look EXACTLY like the source area.
    b. See the code in red below that creates the 'Active X' CheckBoxes (identical to the code in the link referenced above).
    A 'Linked Cell' for each CheckBox as the cell underneath the CheckBox. The cell has custom formatting of 3 semi-colons [;;;] which hides the contents of the cell.
    c. The CheckBox is not copied to the Destination Sheet. Please let me know if you require the Checkbox to be copied.

    CheckBox Creation Code:
    Please Login or Register  to view this content.
    See the attached file which was created in Excel 2003. Active 'X' controls do not transport well between Excel versions or across state lines or International borders. I deleted all the 'Active X' CheckBoxes on 'Sheet1'. Before you use the attached file, you will have to add the 'Active X' CheckBoxes in Column 'E' using the Cyan Colored CommandButton.
    The following code in Ordinary Code Module ModCopyRows:
    Please Login or Register  to view this content.
    It is a best practice to declare all variables. If you misspell a variable in your code, VBA will silently assume it is a Variant variable and go on executing with no clue to you that you have a bug. Go to the VBA development window, click Tools, Options, and check "Require Variable Declaration." This will insert the following line at the top of all new modules:
    Please Login or Register  to view this content.
    This option requires all variables to be declared and will give a compiler error for undeclared variables.

    Lewis

+ 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. Too Many Active X Check Boxes
    By joshag in forum Excel General
    Replies: 5
    Last Post: 02-29-2016, 05:32 PM
  2. [SOLVED] userform to refer to active X check boxes in excel
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-31-2015, 01:10 PM
  3. Active X and Mac OS - check boxes
    By wpryan in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-01-2015, 08:19 AM
  4. [SOLVED] HELP, formula for selecting multiple active x check boxes
    By joe318e in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-24-2014, 09:46 PM
  5. Replies: 0
    Last Post: 06-22-2014, 04:18 PM
  6. Clearing check boxes in active sheet only
    By 2funny4words in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-27-2012, 12:13 PM
  7. [SOLVED] Problem Deleting Check Boxes created from Forms Toolbar
    By Suzan in forum Excel General
    Replies: 4
    Last Post: 09-15-2005, 02:05 PM

Tags for this Thread

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