+ Reply to Thread
Results 1 to 4 of 4

VBA Copy values of last 20 worksheets

  1. #1
    Registered User
    Join Date
    06-19-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    30

    VBA Copy values of last 20 worksheets

    Hi
    I would be grateful for your help. I have a workbook that contains 25 individual worksheets, the first five of which are called "calc1 to 5" I need to be able to export/copy the values of each of the last 20 worksheets, the first one is positioned after the worksheet "calc5" to another workbook with the same worksheet names.

    Grateful for your help.

    Thanks

    Nick

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

    Re: VBA Copy values of last 20 worksheets

    Try this...

    Please Login or Register  to view this content.
    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
    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
    48,477

    Re: VBA Copy values of last 20 worksheets

    One way:

    Please Login or Register  to view this content.

    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


  4. #4
    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
    48,477

    Re: VBA Copy values of last 20 worksheets

    Just be wary of using the Sheet Index to select and copy the sheets. The order of the sheets will depend on whether or not the sheets have been moved around.

    For example:

    Please Login or Register  to view this content.

    Output (in the Immediate Window):

    Please Login or Register  to view this content.

    In this example, Sheet5 was dragged to the first position, Sheet3 was dragged between Sheet1 and Sheet2 and it was renamed as Sheet7.


    Regards, TMS

+ 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. Copy certain worksheets (values only) to a new workbook
    By vbanewbie! in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-17-2013, 07:40 PM
  2. Copy Paste Values all worksheets & creating new worksheets
    By ryan2600 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-05-2012, 11:46 AM
  3. Copy Paste Values and locked worksheets
    By cullism in forum Excel General
    Replies: 1
    Last Post: 05-31-2012, 04:55 AM
  4. Copy values across worksheets
    By SueWithQuestion in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-18-2010, 08:04 AM
  5. copy between worksheets does not copy formulae just values
    By Chris@1000 Oaks in forum Excel General
    Replies: 0
    Last Post: 03-19-2006, 07:50 AM

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