Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: VBA path for save as

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Does anyone know a way to alter the following VBA code to include a directory path? This subroutine saves the file with a name taken as the value in cell "A2" of sheet 1, but I need to add in a directory path to save the file where I want to.

    Thanks in advance.............

    Sub named_save

    Sheets("Sheet1").Select
    ThisFile = Range("A2").Value
    ActiveWorkbook.SaveAs Filename:=ThisFile
    ActiveWindow.Close

    End Sub

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi
    Sub named_save

    Sheets("Sheet1").Select
    ThisFile = "C:MypathFolderNameEct" & Range("A2").Value & ".xls"
    ActiveWorkbook.SaveAs Filename:=ThisFile
    ActiveWindow.Close

    End Sub
    Use singe

    [ This Message was edited by: TsTom on 2002-04-25 21:39 ]

  3. #3
    New Member
    Join Date
    Apr 2002
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks that works great now!!
    cheers

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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