+ Reply to Thread
Results 1 to 4 of 4

VBA to break links when copying tab to new workbook

  1. #1
    Registered User
    Join Date
    03-07-2015
    Location
    Charlotte, NC
    MS-Off Ver
    2013
    Posts
    11

    VBA to break links when copying tab to new workbook

    Hi everyone,
    I have an Excel 2013 workbook that I use a click button with VBA to copy and save the tab to a new workbook and it copies only the values as it should but...it also copies the button that is used in the original tab and keeps the link to that VBA. I would like to eliminate that button and link automatically within the original VBA. Is it possible to add something to this VBA or modify it so that the button with the VBA on the original page does not copy to the new workbook or at least remove the link to the VBA? Removing the button automatically would be nice but just removing the link automatically would be good enough. I am kinda new to this.
    This is the VBA that I use to copy the tab to the new workbook by clicking the button on the original page:

    Please Login or Register  to view this content.
    Thanks for any help,
    Foos Master
    "Foosball is Therapy"
    Last edited by Foos Master; 03-07-2015 at 09:31 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,424

    Re: VBA to break links when copying tab to new workbook

    I would suggest that you create a temporary sheet within the source workbook. Then copy and paste the values and formats from the source sheet to the temporary sheet ... and maybe autofit the columns. Then move the temporary worksheet to the new workbook (not copy).

    Theoretically, that should give you a new workbook with one sheet with the values and formats but no button(s).


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: VBA to break links when copying tab to new workbook

    Hi Foos Master and welcome to ExcelForum,

    One of the following may help you:
    Please Login or Register  to view this content.
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here\

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

    Lewis

  4. #4
    Registered User
    Join Date
    03-07-2015
    Location
    Charlotte, NC
    MS-Off Ver
    2013
    Posts
    11

    Re: VBA to break links when copying tab to new workbook

    Thank you Very much. The top code worked Perfectly. Again, Thank you Very much.

+ 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. How do I break links in a workbook?
    By Dave Peterson in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-06-2005, 03:05 PM
  2. How do I break links in a workbook?
    By Alwebster6635 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  3. [SOLVED] How do I break links in a workbook?
    By Dave Peterson in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 06:05 AM
  4. How do I break links in a workbook?
    By Alwebster6635 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  5. [SOLVED] How do I break links in a workbook?
    By Alwebster6635 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM

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