+ Reply to Thread
Results 1 to 3 of 3

Copy sheets with buttons to new workbook

  1. #1
    Registered User
    Join Date
    03-28-2017
    Location
    Kansas
    MS-Off Ver
    MS Office Pro Plus 2013
    Posts
    4

    Copy sheets with buttons to new workbook

    Hello everyone. I'm a new user, so I hope this is the right sub-forum.

    How do I make a button look for the specified macro within the current workbook, rather than looking back to the workbook the sheet was copied from?

    Background:
    I have a master workbook containing template worksheets. The template worksheets have buttons linked to macros in the workbook modules.

    Users copy the master workbook to multiple folders across the server. They also make multiple copies of the template worksheets within their new copy of the workbook. Everything seems fine up to this point.

    The problem arises when users copy a sheet from one workbook to another. The named ranges are set up to allow this without creating external links, but the buttons are not. The buttons remain linked to the macro in the workbook the sheet was copied from.

    This becomes very problematic as files are moved and archived. I can’t restrict users from copying sheets between workbooks, so I’m hoping there’s a way to fix the buttons so they don’t look for external references.

    Any ideas?

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Copy sheets with buttons to new workbook

    Use ActiveX-type command buttons instead of the Form-type buttons. They don's have this issue because their code is in their worksheet's code module which is copied with the sheet.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    03-28-2017
    Location
    Kansas
    MS-Off Ver
    MS Office Pro Plus 2013
    Posts
    4

    Re: Copy sheets with buttons to new workbook

    Thank you! That's very good to know.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Copy sheet to new workbook but not the Macro buttons
    By rpinxt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2014, 09:05 AM
  2. [SOLVED] Need one copy function that can work on multiple copy buttons and multiple sheets
    By D_Step in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-03-2012, 10:23 PM
  3. [SOLVED] Copy All Visible Sheets To New Workbook Excluding Specific Sheets
    By ezrizer in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-19-2012, 02:19 PM
  4. Replies: 4
    Last Post: 09-15-2012, 02:18 PM
  5. Copy sheets from different workbooks to specific sheets in one workbook
    By erikfae in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-16-2011, 08:02 AM
  6. Automatically Copy sheets in one workbook to create sheets in a new workbook..
    By leebarratt in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-13-2011, 03:14 AM
  7. Replies: 4
    Last Post: 05-15-2005, 07:07 PM

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