+ Reply to Thread
Results 1 to 3 of 3

Question about checkboxes and VBA

  1. #1
    Registered User
    Join Date
    04-07-2020
    Location
    Florida
    MS-Off Ver
    2002
    Posts
    5

    Question about checkboxes and VBA

    Hello all!

    I hope you're all cozy and safe at home.

    I'm building a form that has multiple checkboxes in a single cell. Users fill out the form and click an Enter button. Everything they filled out is copied to another worksheet.

    #1 - How do I export the checkboxes that were selected to my destination sheet? I want the selections to appear in one cell, separated by commas.
    #2 - How can I prevent the Enter button from overwriting/pasting over itself in the destination sheet? I need it to go to the next empty row each time it's clicked.
    #3 - When I'm done, I want to protect the worksheets. Even though the cell containing the checkboxes isn't locked, you can't interact with the checkboxes when the sheet is protected. Why is this? Is there a workaround?


    An example workbook is attached. The only VBA I have so far is below:


    Please Login or Register  to view this content.

    Thank you!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    04-07-2020
    Location
    Florida
    MS-Off Ver
    2002
    Posts
    5

    Re: Question about checkboxes and VBA

    OK, I figured out #2. Still having issues with the checkboxes though.


    Please Login or Register  to view this content.

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

    Re: Question about checkboxes and VBA

    Hi XinYoung and welcome to ExcelForum,

    There are two types of CheckBoxes you can put on the Spreadsheet:
    a. 'ActiveX' CheckBoxes which have more capabilities, are harder to work with, and DO NOT PLAY WELL WITH OTHERS. 'ActiveX' CheckBoxes tend to move and or disappear and possibly cause other problems on a whim. They should probably be avoided.
    b. 'Forms' CheckBoxes which look ugly but are socially friendly.

    Having said that, I used your existing 'ActiveX' CheckBoxes, and added a few 'Forms' CheckBoxes in Cell 'B4' so you could see the difference, and provided code using both. The following code is included in the attached modified copy of your file in Ordinary Code Module ModCheckBoxInterface. I also included code to Protect/Unprotect Sheet 'Form'. The same things can be done manually.
    Please Login or Register  to view this content.
    To prevent typos from ruining days and weeks of work 'Option Explicit' is NEEDED at the top of each code module. This prevents errors caused by missspellings and FORCES every variable to be DECLARED (e.g. Dim i as Integer). http://www.cpearson.com/excel/DeclaringVariables.aspx

    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. [SOLVED] Checkboxes - How to check/uncheck other checkboxes based on another checkbox
    By brooklyn_87 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 10-27-2017, 01:20 PM
  2. [SOLVED] For each checkboxes in userform question
    By moosmahna in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-06-2017, 01:28 PM
  3. [SOLVED] Toggle between userform checkboxes for multiple pairs of checkboxes
    By L plates in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 04-25-2016, 06:31 AM
  4. Rookie VBA question - How to tick TWO checkboxes on a webpage?
    By andba731 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-20-2014, 05:50 PM
  5. Replies: 4
    Last Post: 04-28-2013, 12:47 AM
  6. Print Sheets based on checkboxes in UserForm, Checkboxes also control another macro
    By krackaberr in forum Excel Programming / VBA / Macros
    Replies: 34
    Last Post: 03-05-2013, 11:12 AM
  7. Question on CheckBoxes
    By jamie.c in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-31-2007, 09:25 AM

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