+ Reply to Thread
Results 1 to 2 of 2

checkbox cell range change vba

  1. #1
    Registered User
    Join Date
    07-14-2008
    Location
    Madrid
    Posts
    2

    checkbox cell range change vba

    Hello

    I got 2 checkboxes and I want to run a macro which depending on the value selected on the first checkbox will display a different information on a the second checkbox.

    I got some questions:
    --when I assign a macro to the checkbox (right click over checkbox-->assign macro), how can I access the current selected value of the checkbox?
    --How can I redefine a different range to be taken by the 2nd checkbox depending on the value selected on the 1st checkbox?

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi,

    Presumably you're referring to the Excel checkbox control rather than the Activex UserForms controls in the VBE?

    The view Code window of the checkbox is actually the Checkbox_Click event, and the default values are either True or False. e.g. put the following in the code
    Please Login or Register  to view this content.
    and see it toggle between True/False as you click the button. Hence you access the value by simply referring to it.

    I'm confused by your second question. Are you sure you really mean a checkbox? A checkbox can't 'take a range', it's essentially just a binary control. You can check the state of a checkbox and do things like naming a range according to its state, but in that case you'd presumably build that into the Checkbox 1 click event.

    Can you explain a little further
    Last edited by Leith Ross; 07-14-2008 at 03:35 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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