Results 1 to 19 of 19

How do I save a WorkBook using only select cells macro

Threaded View

  1. #3
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,038

    Re: How do I save a WorkBook using only select cells macro

    Give this a try...
    Option Explicit
    
    Sub SaveInvWithNewName()
        Dim NewInv As Variant
        Dim NewBook As Workbook
        NewInv = "C:\Invoices\LeeValley-Inv" & "-" & ActiveSheet.Range("F2").Value & ".xlsx"
        ActiveSheet.Range("A1:K40").Copy
        Set NewBook = Workbooks.Add
        NewBook.Worksheets("Sheet1").Range("A1").PasteSpecial (xlPasteValues)
        NewBook.SaveAs Filename:=NewInv
        MsgBox "File Saved to C:\Invoices"
    End Sub
    Last edited by Sintek; 04-27-2017 at 04:50 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA / Macro to Select File and Save As
    By bloomingcarrot in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-17-2015, 01:13 AM
  2. [SOLVED] Macro to save workbook - Create Directories / Sub-Directories Based using text in cells
    By kspeese in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-06-2014, 01:21 PM
  3. [SOLVED] Save the split the workbook file type as Excel Binary Workbook From Run Macro
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-25-2013, 05:09 AM
  4. Macro to open a closed workbook and select copy cells into an open workbook
    By helloganesh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-10-2013, 02:00 PM
  5. [SOLVED] Macro to pull out data from specific cells and save it in another workbook
    By kittu55 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-02-2013, 11:02 AM
  6. Macro to select cells and save as html
    By itmanusa in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-27-2010, 09:20 AM
  7. [SOLVED] Select sheet tabs in workbook & save to separate workbook files
    By stratocaster in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-01-2006, 11:40 AM

Tags for this Thread

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