Hi all,
I searched around but could not find an answer to my question.
Looking for a VBA that will save my file with a file name defined by cell A1 to a path defined by specific network path and folder name in cell A2.
Tried several versions of codes I found online, but cannot find all the conditions in one place. When I try to merge all the conditions, I keep getting errors.
Could you please help?
Private Sub filename_cellvalue()
Dim Path1 As String
Dim Path2 As String
Dim filename As String
Path1 = "X:\test1\test2\test3"
Path2 = Range("A2")
filename = Range("A1")
ActiveWorkbook.SaveAs filename:=Path1 & Path2 & filename & ".xls", FileFormat:=xlNormal
End Sub
Thanks,
Alex
I searched around but could not find an answer to my question.
Looking for a VBA that will save my file with a file name defined by cell A1 to a path defined by specific network path and folder name in cell A2.
Tried several versions of codes I found online, but cannot find all the conditions in one place. When I try to merge all the conditions, I keep getting errors.
Could you please help?
Private Sub filename_cellvalue()
Dim Path1 As String
Dim Path2 As String
Dim filename As String
Path1 = "X:\test1\test2\test3"
Path2 = Range("A2")
filename = Range("A1")
ActiveWorkbook.SaveAs filename:=Path1 & Path2 & filename & ".xls", FileFormat:=xlNormal
End Sub
Thanks,
Alex