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

Closed
Lizzie - Sep 18, 2010 at 11:06 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Sep 19, 2010 at 06:10 AM
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
Related:

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Sep 19, 2010 at 06:10 AM
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
0