+ Reply to Thread
Results 1 to 4 of 4

Check if button exists in cell?

  1. #1
    Registered User
    Join Date
    09-28-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    21

    Check if button exists in cell?

    Is there a way to check if a button already exists in the cell? (The regular button, not the command button)

    Also, if anyone knows a good resource on VBA code for placing the button within the cell, that would be greatly appreciated.

    Right now I'm using a variation of the following code:
    Please Login or Register  to view this content.

    I would like to put but a slight margin so the button is within the cell, but not touching the 4 sides, or at least 3 of the sides so I can get the row number that I want from the button placement through something like this:
    Please Login or Register  to view this content.
    Thank You!
    GunNam

  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,259

    Re: Check if button exists in cell?

    Hello GunNam,

    This may help you. Here is a macro to insert command buttons automatically into the cells in a selection. It will ask if you want to attach a macro and also if you want to add a linked cell. I wrote this about a year ago to insert check boxes. I modified it for command buttons (Forms type).
    Please Login or Register  to view this content.
    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
    Registered User
    Join Date
    09-28-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Check if button exists in cell?

    Thank You Leith for your input.

    Is there a way to check to see if the button is in the cell prior to creating the button?

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Check if button exists in cell?

    Buttons are never in cells. They reside on the drawing layer above the worksheet. They may cover a cell, but that does not interfere with the cell holding constants or formulas.

    You might try.
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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