+ Reply to Thread
Results 1 to 7 of 7

Re-assignment of Macro to Command button

  1. #1
    Registered User
    Join Date
    04-15-2009
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    3

    Unhappy Re-assignment of Macro to Command button

    Hello List

    I have a problem in XL regarding redefining the Macro assignment of radio button when the source worksheet is copied to a Destination worksheet within a new workbook.

    When i click on the radio button in the Destination worksheet, it attempt to open the Source workbook RATHER to run the macro assigned to the button.

    I have checked and the Destination workbook DOES indeed have identical copy of the macro, as the original Source workbook. However, by Right clicking / Assign Macro on the radio button, i find that the path STILL points to the source workbook/worksheet.

    I tried the following code, but it does not work.

    Please Login or Register  to view this content.
    I would appreciate your suggestion, how to modify the last Selection.OnAction code so that XL knows to pick it from the Destination worksheet, instead of jumping back to the original source workbook.

    Thanks
    Last edited by mrbundle; 04-15-2009 at 09:30 PM.

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

    Re: Re-assignment of Macro to Command button

    Welcome to the forum, mrbundle.

    Please take a few minutes to read the forum rules, and then edit your post to add code tags.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    04-15-2009
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    3

    Re: Re-assignment of Macro to Command button

    Hello again List

    Sorry, i ended up replying to my own post, while i was trying to edit it!
    Last edited by mrbundle; 04-15-2009 at 09:32 PM.

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

    Re: Re-assignment of Macro to Command button

    This works fine for me, assigning a macro and then saving as a different name:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-15-2009
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    3

    Re: Re-assignment of Macro to Command button

    Hello again

    I have checked the copied worksheet in the Destination workbook and it
    DOES indeed have an identical copy of the macro, as the original
    Source workbsheet/workbook. However, upon by Right clicking / Assign
    Macro on the radio button in the Destination worksheet, i find that
    the path STILL points to the source workbook/worksheet.

    I tried the following 2 options of codes, but neither seems to work.

    VBA Code:
    'Re-assign/point Radio buttons to Macro copy with New Workbook

    CODE 1
    Please Login or Register  to view this content.
    CODE 2
    Please Login or Register  to view this content.
    It's pretty frustrating especially when i have a deadline to do this.
    Your suggestions would be greatly appreciated as to how to re-assign /
    get the new worksheet OPTION button to point to the macro "Daily"
    residing within the new worksheet. ( i tried putting the "Daily" macro
    in a module instead of the new worksheet "sheet1" but still wont work.... :-(

  6. #6
    Registered User
    Join Date
    05-04-2009
    Location
    Navarre, FL
    MS-Off Ver
    Excel 2007
    Posts
    1

    Talking Re: Re-assignment of Macro to Command button

    I had the same problem and based upon your code plus a couple of other sites came up with this:

    Please Login or Register  to view this content.
    This is for copying into a similar work book and checking two buttons for the correct call reference. Kept a couple of debug statements in it.

    Hope this helps.

    xling
    Last edited by xling; 05-04-2009 at 05:19 PM.

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

    Re: Re-assignment of Macro to Command button

    Welcome to the forum, xling.

    Please take a few minutes to read the forum rules (link in the menu bar), and then edit your post to add code tags.

+ 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