+ Reply to Thread
Results 1 to 5 of 5

Tick a specific checkbox base upon the value of another cell

  1. #1
    Registered User
    Join Date
    02-19-2017
    Location
    Maryland
    MS-Off Ver
    2013
    Posts
    2

    Tick a specific checkbox base upon the value of another cell

    I recently converted a physical form that students are required to fill out by hand into a web based form. The data is subsequently exported to an Excel spreadsheet. From there I want to transfer the data to a report that will be printed out and placed in the students file. The format of the report will look identical to the physical form and includes checkboxes. My challenge is to write a code that selects a specific checkbox based upon the value in the cell of the exported spreadsheet. For example, one question students are asked is "Are you a veteran?" to which they either answer "Yes" or "No". Based on their response I would like to tick either the "Yes" checkbox or "No" checkbox in the report.

    So far I have only found posts showing how to select/deselect all checkboxes in a sheet or range but not how to select a specific one. Any help would be appreciated. Thanks!

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Tick a specific checkbox base upon the value of another cell

    Hello cyberburn,

    Welcome to the Forum!

    It would be a great help if you posted the workbook. It will save time and get you a working answer faster.

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show your desired results.

    Please redact or change any information that is confidential, personal, or sensitive in nature before you post your workbook.

    To Attach a File:
    1. Scroll down to the window below your post Additional Options
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

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

    Re: Tick a specific checkbox base upon the value of another cell

    Based on a Yes\No value in Sheet1 A1, this will check either Check Box 1 or Check Box 2 on Sheet2.

    This presumes your check boxes are Form-Type check boxes and not ActiveX-type check boxes.

    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.

  4. #4
    Registered User
    Join Date
    02-19-2017
    Location
    Maryland
    MS-Off Ver
    2013
    Posts
    2

    Re: Tick a specific checkbox base upon the value of another cell

    Thanks AlphaFrog! That did the trick. To follow up, I initially renamed the checkboxes (and code to match) but when I ran the macro I got the error "Unable to get the CheckBoxes property of the worksheet class". However when I changed them back to the default names it worked fine. Must default names be used? Doesn't make much sense if they do. thanks again.

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

    Re: Tick a specific checkbox base upon the value of another cell

    You're welcome.

    The default names do not have to be used. My first guess is you didn't have the check box names or sheet name in the code exactly the same as the changed names.

+ 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. 1 checkbox tick from 3
    By Villalobos in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-25-2014, 07:12 AM
  2. [SOLVED] VBA code to populate checkbox with tick upon initialization based on Cell value being Yes
    By michelle 1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-05-2013, 09:58 AM
  3. [SOLVED] Marlett Checkbox in one cell and tick in different cell
    By escobf in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-31-2013, 12:59 PM
  4. Using cell as checkbox (add tick mark)
    By ThePixie in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 01-05-2013, 12:02 AM
  5. [SOLVED] Tick checkbox if a certain cell is not empty.
    By jazzy747 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-12-2012, 05:43 PM
  6. tick checkbox to trigger another checkbox
    By aviflux in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-28-2008, 07:59 AM
  7. Copy tick from checkbox to another checkbox
    By AngieE in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-19-2007, 07:45 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