+ Reply to Thread
Results 1 to 9 of 9

Cell Link assignment for check boxes

  1. #1
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Cell Link assignment for check boxes

    Is there a way to create a check box, assign cell link,
    then copy the check box multiple times and have the cell link follow in a relative fashion.
    In other words all subsequent check boxes would have different cell links.
    modytrane

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Cell Link assignment for check boxes

    I doubt it. I am pretty sure there is no referential relationship between an object you add to your sheet and the sheet itself. How would it know which cell to reference to when it was copied?

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

    Re: Cell Link assignment for check boxes

    Hello Modytrane,

    I revised this macro I wrote a back in March. This macro will automatically add a CheckBox to each cell you have selected. When it starts, you will be asked if you want to add a macro and a linked cell to the check boxes. The same macro will be run by each check box if you choose to add one. The link cell will update based on Excel's absolute and relative referencing for A1 style entries. You can link to another worksheet when prompted by including the sheet with the range, like this...
    Please Login or Register  to view this content.
    Adding the Macro
    1. Copy the macro above pressing the keys CTRL+C
    2. Open your workbook
    3. Press the keys ALT+F11 to open the Visual Basic Editor
    4. Press the keys ALT+I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Paste the code by pressing the keys CTRL+V
    7. Make any custom changes to the macro if needed at this time.
    8. Save the Macro by pressing the keys CTRL+S
    9. Press the keys ALT+Q to exit the Editor, and return to Excel.

    To Run the Macro...
    To run the macro from Excel, open the workbook, and press ALT+F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.
    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!)

  4. #4
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Cell Link assignment for check boxes

    Leith,
    The macro works well, thank you.
    I am not sure about the size of the check box though.
    It seems like the size is same regardless of the cell size.
    I have another thread for that issue, but since you mentioned that your macro addresses the size, I thought I would ask you here.
    I'll make sure to close the other thread if it gets addressed here.

    Thanks again,
    modytrane.

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

    Re: Cell Link assignment for check boxes

    Hello moodytrane,

    When I first wrote the macro, it was to add a check box without a caption that would match the cell's height. Tell me what you need and I'll modify the code for you.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Cell Link assignment for check boxes

    Modytrane, are you familiar with Marlett checkboxes? They are easy to implement in code, and are on the same layer as the rest of the data. Here's an example:

    In the sheet module:
    Please Login or Register  to view this content.
    In a code module:
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Cell Link assignment for check boxes

    shg,
    I am not familiar with the Marlett checkboxes.
    I'll look in to it.
    Thanks for the suggestion.

    Leith,
    As I said before, your macro works but the size of the checkbox seems to be fixed relative to the cell.
    Is there a way to modify your macro, so that the checkbox will be as high and as wide as the cell? Or is it possible to size the checkbox manually?
    Thanks for your help,

    modytrane.

  8. #8
    Registered User
    Join Date
    10-23-2012
    Location
    Washington, DC
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Cell Link assignment for check boxes

    @ shg, I have come across this thread in an effort to modify my Marlett Checkbox code and you seem to be very familiar with this. I am trying to figure out how to make the Target cell where the "a" actual goes in a different cell (different column in a second table) from the cell that is actually selected.

    Does this make sense? Any help is greatly appreciated

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Cell Link assignment for check boxes

    escobf,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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