Consulting

Page 2 of 2 FirstFirst 1 2
Results 21 to 24 of 24

Thread: Copy Active sheet to new workbook.

  1. #21
    VBAX Regular
    Joined
    Mar 2009
    Posts
    12
    Location
    Gentlemen,

    Thank you once again. This is a fantastic help site!

    Mark,
    You are correct. Since I close the original without saving it reverts back to protected.

    This brings up another idea Is there a way to close the original and keep the new workbook open after the save as dialog?

  2. #22
    VBAX Regular
    Joined
    Mar 2009
    Posts
    12
    Location
    Gentlemen,

    I think I did not post my last reply correctly. Sorry.

    Mark,
    You are correct the close without saving reverts back to protected.

    This brought up another idea. Can I close with saving the original and keep the new workbook open?

    Thank you again.
    This site is Fantastic!

  3. #23
    VBAX Regular
    Joined
    Mar 2009
    Posts
    12
    Location
    Sorry Gentlemen,

    I found the other post. I didn't realize we made it to two pages.

    Anyway, I found that if I removed the .close False it then kept the new workbook open. I left the ThisWorkbook.close False in at the end and it closes the original perfectly.

    All is working exactly the way I was hoping for!

    Thank you very much for all the help.

  4. #24
    VBAX Newbie
    Joined
    Feb 2018
    Posts
    1
    Location

    Thumbs up I Registered just to thank you for sovling this copy active sheet to new book problem

    Quote Originally Posted by mdmackillop View Post
    Here's a very basic version. No bells and whistles.
    [vba]
    Option Explicit
    Sub CopyActiveSheet()
    Dim ws As Worksheet
    Dim wb As Workbook
    Dim Pth As String
    Pth = ActiveWorkbook.Path & "\"
    Set ws = ActiveSheet
    ws.Copy
    With ActiveWorkbook
    ws.Cells.Copy .Sheets(1).Range("A1")
    .SaveAs Pth & InputBox("File name") & ".xls"
    .Close
    End With
    ActiveWorkbook.Close False
    End Sub
    [/vba]

Posting Permissions

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