Results 1 to 2 of 2

Thread: VBA for Excel - Save As, can I change the name?

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    Minneapolis
    Posts
    12
    I have a macro that creates a new workbook. I need to save this new workbook in a specific folder, and change the name to a name that appears in a specific cell in the original workbook. I cant get the name of the new workbook to change from "Book1". Is this possible?
    Thanks
    Douglas

  2. #2
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Use the recorder and record your steps on how normally you would save a file.

    The basic code is like this.
    Code:
        Windows("Book2").Activate
        Dim str_FileName As String
        str_FileName = Range("A1").Value & ".xls"
        
        Windows("Book1").Activate
        ActiveWorkbook.SaveAs Filename:=str_FileName
    Chemically Formulated As:
    Dr. Nitro

Posting Permissions

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



Click Here to Expand Forum to Full Width