Results 1 to 10 of 15

Thread: VBA Macro To Create An Excel File With Same Sheet Name As Workbook Name

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #10
    Senior Member
    Join Date
    Jun 2012
    Posts
    337
    Rep Power
    14
    or ?

    Code:
    Sub M_snb()
        Thisworkbook.Sheets(1).Copy
        With ActiveWorkbook
             .SaveAs ThisWorkbook.Name, 23
             .Close 0
         End With
    End Sub
    or

    Code:
    Sub M_snb()
        ThisWorkbook.Sheets(1).Copy
        With ActiveWorkbook
             .SaveAs CreateObject("scripting.filesystemobject").getbasename(ThisWorkbook.FullName), 23
             .Close 0
         End With
    End Sub
    Last edited by snb; 09-06-2016 at 03:54 PM.

Similar Threads

  1. Replies: 4
    Last Post: 07-02-2013, 11:32 AM
  2. Replies: 4
    Last Post: 06-18-2013, 01:38 PM
  3. VBA To Create A New Workbook
    By cdurfey in forum Excel Help
    Replies: 9
    Last Post: 05-23-2013, 06:41 PM
  4. Excel VBA Macro To Open A File Through Browse Dialog Box
    By Safal Shrestha in forum Excel Help
    Replies: 2
    Last Post: 04-05-2013, 12:59 PM
  5. Replies: 1
    Last Post: 06-02-2011, 10:38 AM

Posting Permissions

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