+ Reply to Thread
Results 1 to 10 of 10

Saving Individual Tabs as Files

  1. #1
    Registered User
    Join Date
    03-17-2005
    Posts
    19

    Saving Individual Tabs as Files

    I have a large spreadsheet with lots of tabs. I would like to save each tab as a separate spreadsheet. How do I write a MACRO to do that?

  2. #2
    Forum Contributor starryknight64's Avatar
    Join Date
    09-27-2006
    Location
    Missouri
    MS-Off Ver
    2003 (Work) & 2007 (Home)
    Posts
    193

    Re: Saving Individual Tabs as Files

    For beginners, Record Macro is your new best friend. I'd give that a shot.

    1. Just goto Tools-->Macro-->Record New Macro...
    2. Click OK
    3. Do whatever it is you're wanting to do (in your case, just save one of the sheets as a different workbook)
    4. Click the stop button (just like on a VCR)

    To see the code you just recorded, hit ALT + F11 and expand the Modules folder on the left. In it should be "Module1", where your code is located.

    Just double-click on Module1 and there it is.

    I hope that helps!
    starryknight64

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Saving Individual Tabs as Files

    The following cod will copy the active sheet to a new workbook
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Saving Individual Tabs as Files

    hi Don,

    You should find the below link useful:
    http://www.mvps.org/dmcritchie/excel/saveas.htm

    I found the above using this google search: http://www.google.co.uk/search?hl=en...meta=&aq=f&oq=

    StarryKnight, I agree that recording macros can be a beginners best friend & a recorded macro does provide the basic bones of what the OP has asked, but in this case, to revise it into a looping macro ("for each tab") is likely to be above their immediate abilities. So I would add number 5 to your list as something along the lines of "review the resulting code & make it more generic by changing hardcoded strings to variables etc" & 6...
    However, thanks to the wizzes, a ready made solution already exists

    hth
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Saving Individual Tabs as Files

    Something like this should split each sheet to a separate workbook
    Please Login or Register  to view this content.

  6. #6
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Saving Individual Tabs as Files

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-06-2015
    Location
    oakville,ontario,canada
    MS-Off Ver
    2010
    Posts
    2

    Re: Saving Individual Tabs as Files

    Hi! I am trying out your macro and I am getting stuck on this line of the script. Can you please help me?

    wb.Sheets(1).Delete

    Runtime error indicated the following:

    'workbook must contain at least one visible worksheet.'

    Thank you,
    Ailene
    Attached Images Attached Images

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Saving Individual Tabs as Files

    ailenetg welcome to the forum

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  9. #9
    Registered User
    Join Date
    10-06-2015
    Location
    oakville,ontario,canada
    MS-Off Ver
    2010
    Posts
    2

    Re: Saving Individual Tabs as Files

    ok thanks,

    I am new here and do not really know yet.

    Ailene

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Saving Individual Tabs as Files

    No problem, we all have to start somewhere

+ 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