Q:

Excel VBA to save to specific folder (with current code generating filename)

workers,
I have this code at the moment;
Public Sub SaveAsA1()
    ActiveWorkbook.SaveAs Filename:=Range("P4").Value & ";" & Range("F6").Value & ";" & Range("R6").Value & ";" & Range("R4").Value
End Sub

Which i would like to modify to be saved in a certain filemap; \S31000265\Users$\NR4236\My Documents\TV-01-project\TestmapWeek9GOED. Been trying but it keeps overwriting the Filename-code. Hope you guys can help me out.

A:

Public Sub SaveAsA1()
    ChDir ("C:\work\testout\") ' Directory you need to save the file as xlsm
    Filename = Range("P4").Value & ";" & Range("F6").Value & ";" & Range("R6").Value & ";" & Range("R4").Value
    ActiveWorkbook.SaveAs Filename:=Filename, FileFormat:=52
End Sub

