+ Reply to Thread
Results 1 to 4 of 4

Macro to copy specific sheet

  1. #1
    Registered User
    Join Date
    01-05-2009
    Location
    Southern Pines, NC
    MS-Off Ver
    Excel 2007
    Posts
    95

    Macro to copy specific sheet

    I have a file with a macro that creates a new sheet named New Record. We use this new sheet to enter data and then rename the sheet 2010Q1, 2010Q2 etc to represent the year and current quarter.
    I now want to have a macro that is capable of coping anyone of the sheets (depending on which tab I want to copy at that time). What would be even better, if possible, is to export the requested sheet to a PDF.

    Anyone know if this is possible and if so, how?

    thanks,

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to copy specific sheet

    This will present a little popup of all the sheets in the workbook. Select one and it will copy that sheet to a new workbook.
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    01-05-2009
    Location
    Southern Pines, NC
    MS-Off Ver
    Excel 2007
    Posts
    95

    Re: Macro to copy specific sheet

    This worked perfect, thanks. However, the game plan has changed. Now we need to be able to export multiple sheets at one time, I know we could just run this macro multiple times and copy them into one workbook, but the goal is to make this as user friendly as possible for our client. Is it possible to adjust the code below to allow exporting multiple sheets at one time?

    For example, say I have four sheets, Sheet1 through Sheet4 and want to export three of these. Next time I may want to export only two sheets etc…

    Thanks,

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to copy specific sheet

    Try this...it will select all the sheets you want, then copy them to a new workbook, then deselect them in the original workbook again.
    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 05-27-2010 at 10:55 AM.

+ 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