Consulting

Results 1 to 2 of 2

Thread: Solved: create a copy

  1. #1
    VBAX Tutor
    Joined
    Nov 2007
    Posts
    291
    Location

    Solved: create a copy

    When you right click a tab in a workbook you can create a copy of this sheet.

    Is there a way to do this in VBA and then copy and paste the values in the new worksheet and then prompt the user to save the new workbook and suggest a filename (the date in the format 06.01.2008, where the report date is currently in the format 6/1/2008). And then save the new workbook and return to the workbook you started from.

    All this has to be done from the existing workbook you started out from

  2. #2
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    [VBA]Activesheet.copy [/VBA] will create a copy of your worksheet in a new workbook use
    [VBA]
    ActiveWorkbook.SaveAs ActiveSheet.Name & Format(Date, "dd-mm-yyyy")
    [/VBA]to save the workbook as the sheet name plus the date
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

Posting Permissions

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