1

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.

2
  • 1
    whats the values of P4, F6, R6 and R4 ? Commented Apr 18, 2016 at 7:17
  • The values are text, which i use to generate file names based upon employee number, employee name, etc. Values are variable at all times. Commented Apr 18, 2016 at 7:22

1 Answer 1

2
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
Sign up to request clarification or add additional context in comments.

2 Comments

A real hero to me man! Your code runs smooth as it should. Thank you so much!
@RobExcel, Welcome

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.