+ Reply to Thread
Results 1 to 14 of 14

MAcro to export TAB to a new sheet

  1. #1
    Registered User
    Join Date
    09-04-2013
    Location
    Baltimore, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    39

    MAcro to export TAB to a new sheet

    Does anyone have a macro I can use with a button which will export a TAB in excel to a new workbook?

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: MAcro to export TAB to a new sheet


    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-04-2013
    Location
    Baltimore, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: MAcro to export TAB to a new sheet

    Amazing, thank you so much it works perfect.

    Is there a way to have the exported tab without the button that I have in the original version?

  4. #4
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: MAcro to export TAB to a new sheet

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-04-2013
    Location
    Baltimore, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: MAcro to export TAB to a new sheet

    Both macros will not run, just the export one. What am I doing wrong?

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: MAcro to export TAB to a new sheet

    Re: "Both macros will not run"
    Meaning what? Nothing happens or an error message?

  7. #7
    Registered User
    Join Date
    09-04-2013
    Location
    Baltimore, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: MAcro to export TAB to a new sheet

    When I use the fomula belw an error screen pops up saying compile error

    Private Sub CommandButton1_Click()
    ThisWorkbook.ActiveSheet.Copy
    ActiveSheet.Shapes("CommandButton1").Delete
    End Sub

  8. #8
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: MAcro to export TAB to a new sheet

    Is the Button Name "CommandButton1"?

    I use Form Control Buttons and this works

    Please Login or Register  to view this content.

    I tried this (Excel 2007) with an ActiveX control and it worked.
    Obviously, the name needs to be "CommandButton1".
    Please Login or Register  to view this content.
    Last edited by jolivanes; 08-08-2018 at 11:50 AM. Reason: Add info

  9. #9
    Registered User
    Join Date
    09-04-2013
    Location
    Baltimore, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: MAcro to export TAB to a new sheet

    I keep getting the debugger to come up with the fisrt line highlighted yellow. So the macro can't get past the first line.

  10. #10
    Registered User
    Join Date
    09-04-2013
    Location
    Baltimore, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: MAcro to export TAB to a new sheet

    I got it to work. Thank you

  11. #11
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: MAcro to export TAB to a new sheet

    For someone else searching for a solution for a similar problem, could you be so kind and let us know what you did to make it work.
    Thank you very much.

  12. #12
    Registered User
    Join Date
    09-04-2013
    Location
    Baltimore, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: MAcro to export TAB to a new sheet

    Absolutely. I used this:
    Sub export_tab()
    ThisWorkbook.ActiveSheet.Copy
    ActiveSheet.Shapes("Button 1").Delete
    End Sub

    The issue I was having was caused by me changing the "Button 1" name to be the name that I used in the button, which was Export TAB. Once I changed it back to "Button 1" it worked.

  13. #13
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: MAcro to export TAB to a new sheet

    Thank you for the follow up
    Good luck

  14. #14
    Registered User
    Join Date
    09-04-2013
    Location
    Baltimore, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: MAcro to export TAB to a new sheet

    I would like to take this a little further. Is there something I can add to the macro that it will unlock the protection I have on the sheet and change the links to other excel tabs into the values in the cells.

    Thanks

+ 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. Need to adjust macro to only export one sheet but name of sheet partially changes
    By taylorsm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-13-2018, 05:37 AM
  2. Macro to export my sheet to a PP presentation or PDF
    By kb123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-10-2016, 11:14 PM
  3. [SOLVED] Can VBA Export a Sheet to a Non-Macro Enabled File?
    By dhunton in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 05-31-2016, 10:48 PM
  4. Macro sheet export
    By santille in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-21-2014, 11:35 AM
  5. Macro to Export a Sheet but also export a macro?
    By ChrisF79 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-20-2013, 12:26 PM
  6. [SOLVED] Export macro to a new sheet
    By zepelin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-03-2013, 05:27 AM
  7. [SOLVED] Export macro to a new sheet
    By zepelin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-28-2012, 06:56 AM

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