Save a workbook, the same as a cell & to a pa

Closed
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hello,

I am trying to create a Macro that will save my workbook to a filepath F:\file\Doc\XP and name it the same as Cell A1

Many thanks

Lizzie

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
You question leaves out a lot. but in general this is how you would it

    Dim sPath As String

    sPath = "F:\file\Doc\XP\"
    
    If (Trim(Cells(1, "A")) <> vbNullString) Then
       ActiveWorkbook.SaveAs sPath & Trim(Cells(1, "A"))
    End If