+ Reply to Thread
Results 1 to 4 of 4

Macro to save sheets as separate workbooks

  1. #1
    Zorro
    Guest

    Macro to save sheets as separate workbooks

    can anyone help with a macro to save each worksheet as a separate book
    (named as its sheet name) to a given folder (C:\mydocs\myfolder)?

    Many thanks
    Zorro



  2. #2
    Dave Peterson
    Guest

    Re: Macro to save sheets as separate workbooks

    Option Explicit
    Sub testme()

    Dim wks As Worksheet
    Dim newWks As Worksheet

    For Each wks In activeworkbook.worksheets
    wks.Copy 'to a new workbook
    Set newWks = ActiveSheet
    With newWks
    Application.DisplayAlerts = False
    .Parent.SaveAs Filename:="C:\mydocs\myfolder\" & .Name, _
    FileFormat:=xlworkbooknormal
    Application.DisplayAlerts = True
    .Parent.Close savechanges:=False
    End With
    Next wks

    End Sub

    It also overwrites any existing file (if one exists).

    If you're new to macros, you may want to read David McRitchie's intro at:
    http://www.mvps.org/dmcritchie/excel/getstarted.htm

    Zorro wrote:
    >
    > can anyone help with a macro to save each worksheet as a separate book
    > (named as its sheet name) to a given folder (C:\mydocs\myfolder)?
    >
    > Many thanks
    > Zorro


    --

    Dave Peterson

  3. #3
    Ron de Bruin
    Guest

    Re: Macro to save sheets as separate workbooks

    Another one
    http://www.rondebruin.nl/copy6.htm


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "Zorro" <[email protected]> wrote in message news:[email protected]...
    > can anyone help with a macro to save each worksheet as a separate book (named as its sheet name) to a given folder
    > (C:\mydocs\myfolder)?
    >
    > Many thanks
    > Zorro
    >




  4. #4
    Zorro
    Guest

    Re: Macro to save sheets as separate workbooks

    Thanks guys.

    Zorro



    "Ron de Bruin" <[email protected]> wrote in message
    news:[email protected]...
    > Another one
    > http://www.rondebruin.nl/copy6.htm
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "Zorro" <[email protected]> wrote in message
    > news:[email protected]...
    >> can anyone help with a macro to save each worksheet as a separate book
    >> (named as its sheet name) to a given folder (C:\mydocs\myfolder)?
    >>
    >> Many thanks
    >> Zorro
    >>

    >
    >




+ 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