+ Reply to Thread
Results 1 to 8 of 8

Copying Button when copying cell

  1. #1
    Registered User
    Join Date
    12-29-2010
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2004 for Mac
    Posts
    20

    Copying Button when copying cell

    Hi,

    I've run into an issue while building a new user form. It seems that when I copy a row that contains a button, using code through the user form, the button won't transfer once pasted into a new row. The code works perfectly in a regular macro. So, it leads me to believe that something in a private sub won't allow buttons to be copied. If you know of any work-arounds, please let me know!

    I'm using Excel 2011 for Mac.


    Here is the code I am using in the user form...

    Please Login or Register  to view this content.

    Thanks
    Last edited by Einstahb; 08-25-2011 at 03:30 PM.

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

    Re: Copying Button when copying cell

    Mac's only support buttons from the Forms menu. They are not contained in cells. They are really shapes.

    If you want to copy buttons that are over cells, it has to be done seperately from copying the cells.

    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.

  3. #3
    Registered User
    Join Date
    12-29-2010
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2004 for Mac
    Posts
    20

    Re: Copying Button when copying cell

    Hi,

    Thanks for the quick response. If I copy the cell manually or with a basic macro, though, the button in that cell pastes with the copied cell. It must somehow recognize that there is a button in the copied cells, no?

    If there isn't a way to do this with a private sub and I did have to select a specific button, is there a way to move the button with respect to the cells rather than by pixels(or whatever unit is used)?

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

    Re: Copying Button when copying cell

    Do you want to copy the button or move it?

  5. #5
    Registered User
    Join Date
    12-29-2010
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2004 for Mac
    Posts
    20

    Re: Copying Button when copying cell

    I'd like to copy a cell with a button in it and paste the new cell with a copied version of the button in it.

    Essentially I'd like to copy the button.

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

    Re: Copying Button when copying cell

    The is no cell with a button in it. There are some cells with a button over them.
    I think this routine will do what you want, once the Source and destination ranges are set to match your situation. The positioning of the button may be a bit odd if the height and width of the source cells and destination cells is different.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-29-2010
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2004 for Mac
    Posts
    20

    Re: Copying Button when copying cell

    Hi,

    I'm still not completely satisfied with that option but I really appreciate your help. I think I've found a work around. Unfortunately, I couldn't find anything through the user form. I ended up just adding in another macro after the user form is complete, to copy the cell and the button.

    Cheers

  8. #8
    Registered User
    Join Date
    12-29-2010
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2004 for Mac
    Posts
    20

    Re: Copying Button when copying cell

    Hi,

    Using the code you've provided, is there a way to set the destination cell relative to a command button that is controlling the macro? Essentially, I would like to copy a button from cell "Q8" and paste it two cells to the right of the command button I have pressed. This command button could be in any cell so it would be great if I could paste the new command button relative to the called button.

    I've tried the following code but I get a run-time error that I don't quite understand. The only parts that I've changed are the "Set sourceRange" and Set destinationRange".

    Please Login or Register  to view this content.

+ 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