+ Reply to Thread
Results 1 to 4 of 4

How To: Reference a Check Box in VBA

  1. #1
    Registered User
    Join Date
    06-03-2019
    Location
    Charlotte, NC
    MS-Off Ver
    2016
    Posts
    4

    Question How To: Reference a Check Box in VBA

    How do I reference a check box from another worksheet in my VBA code? I want to code that if the box is checked in Sheet1, to then copy a range of cells from Sheet1 onto another worksheet, Sheet2.

    Thanks!

    EDIT: I've attempted to reference my check boxes from sheets PCAPV10, PCAPV16, AND PCAPV22 in the code below. I'm getting an object error.

    Please Login or Register  to view this content.
    *This question has also been posted on Stack Overflow as I need an answer ASAP. Excel Forum will not allow me to post links yet, so my apologies for not linking the post.
    Last edited by enichols; 06-04-2019 at 11:03 AM. Reason: Adding example code I have attempted

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,598

    Re: How To: Reference a Check Box in VBA

    One option: check the linked cell for True
    Ben Van Johnson

  3. #3
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: How To: Reference a Check Box in VBA

    A check box can have a linked cell to show the status of the checkbox.
    You could use this cell for your macro
    Attach an Excel sample file if you want more details
    - Battle without fear gives no glory - Just try

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: How To: Reference a Check Box in VBA

    How did you create the checkbox?

    If it's from the Forms toolbar you could use something like this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

+ 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. Excel formula help - look up reference but also check value
    By snowscreen in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-29-2018, 02:53 PM
  2. [SOLVED] How to check a range´s cell reference
    By peter_swe in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 05-12-2016, 03:17 AM
  3. [SOLVED] VBA Tools Reference-Check if enabled + enable if not?
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-23-2013, 08:46 PM
  4. How do I reference a Form Object Check Box with VBA?
    By mick86 in forum Excel General
    Replies: 11
    Last Post: 09-16-2012, 09:57 AM
  5. Cross reference two sheets and then check another column
    By dagindi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-07-2010, 05:36 PM
  6. VBA code to check for missing reference.
    By arrowone in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-09-2007, 04:16 AM
  7. [SOLVED] Check Box reference name
    By Kris in Kenya in forum Excel General
    Replies: 3
    Last Post: 03-28-2006, 10:20 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