Consulting

Results 1 to 7 of 7

Thread: Checkbox to write values to multiple cells

  1. #1

    Checkbox to write values to multiple cells

    Hi

    I need some help with the following.
    I have a checkbox when checked reveals hidden rows.

    Now I would like when the same checkbox is checked that it would also populate multiple cells in a single column with various numbers. and when it is unselected the cells go back to value of 0.

    Ex. Checked, Cell E2 = 4, E3 = 1, E4 = 2, etc etc.
    Ex. Unchecked, all previous cells = 0

    Thank you,

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    We need to know if it is a "Forms" CheckBox, or a "Control ToolBox" CheckBox. All we can surmise right now is that it is not a VBA Userform CheckBox, all three are treated differently.

    IMHO, the "Forms" Controls are the most difficult to work with.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,728
    Location
    Quote Originally Posted by DoesNotKnow View Post
    Hi

    I need some help with the following.
    I have a checkbox when checked reveals hidden rows.

    Now I would like when the same checkbox is checked that it would also populate multiple cells in a single column with various numbers. and when it is unselected the cells go back to value of 0.

    Ex. Checked, Cell E2 = 4, E3 = 1, E4 = 2, etc etc.
    Ex. Unchecked, all previous cells = 0

    Thank you,
    Please show the code

    Use the [#] icon to insert [CODE] .... [/CODE] tags and paste the macro between then
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  4. #4
    It is an ActiveX control Checkbox

  5. #5
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Gee, I'm really stupid ...Is that a Forms control or a Control Toolbox control.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  6. #6
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,728
    Location
    Things have changed since 2003

    You can put an ActiveX control on a sheet ...

    Capture.JPG


    ... and it has it's own event handler in the worksheet's code page

    Capture1.JPG
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  7. #7
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Things have changed since 2003
    Not Really. Only the name has changed, because the Menu Bar was scrapped for the Ribbon by the Jeune École at MS. They were simply Control Toolbox Controls. But thanks for answering my question, but I already knew the answer. I just HATE IT when new poster doesn't answer our questions.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •