Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Worksheet Breakout (Excel 2003)

    Hi

    This Macro is courtesy of the Allen Wyatt Website, it works just fine, with the exception that instead of it saving to the root directory of C: I would like to put the result in a directory for example
    C:Breakout, I tried Const WBPath = "C:Breakout " but it does not work, any ideas please

    Many Thanks

    Braddy


    Sub BreakItUp()
    Dim sht As Worksheet
    Dim NFName As String
    Const WBPath = "C:"

    For Each sht In ActiveWorkbook.Worksheets
    sht.Copy
    NFName = WBPath & sht.Name & ".xls"
    ActiveWorkbook.SaveAs FileName:=NFName, _
    FileFormat:=xlNormal, CreateBackup:=False
    ActiveWindow.Close
    Next
    End Sub
    If you are a fool at forty, you will always be a fool

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Worksheet Breakout (Excel 2003)

    Like in the original value, the path must end in a backslash , and there shouldn't be a space at the end:
    <code>
    Const WBPath = "C:Breakout"</code>

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Worksheet Breakout (Excel 2003)

    Hi Hans

    Thanks very much.

    Braddy
    If you are a fool at forty, you will always be a fool

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •