Excel auto rename file

Posted on 2009-12-18
Last Modified: 2012-05-08
Hi experts,

Can excel save file name  according to  CELL A1  ?

I had a Template file named: Invoice.xls , everytime  after input all data   manually press  "save as....."  to rename  it  to      Invoice12345.xls   (file name according to the  invoice no.)
the invoice number  is input at  Cell A1  , is it possible  rename file  automatically  ?

Question by:candychan611
    1 Comment
    LVL 8

    Accepted Solution

    Try this macro...
    Sub SaveFile()
        ThisWorkbook.SaveAs ThisWorkbook.Path & "\" & Sheet1.Cells(1, 1).Text & ".xls"
    End Sub

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
    How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
    The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
    This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now