Panir Selvam
06-01-2016, 03:02 AM
Hi All,
I am new in VBA Express forum.
I am stuck with one code. The whole idea is to create a working template. Upon completed a button click will SaveAs the file to the desire location.
With current code, it only able to copy and save the active sheet and rest can't. Hope you guys can help me.
This is the code
Sub SaveInvWithNewName()
Dim NewFN As Variant
ActiveSheet.Copy
NewFN = "D:\kashwin\SDMI-16-DO_" & Range("G13").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
End Sub
Thanks
Edit by Moderator: Moved from Testing sandbox to Excel Forum.
I am new in VBA Express forum.
I am stuck with one code. The whole idea is to create a working template. Upon completed a button click will SaveAs the file to the desire location.
With current code, it only able to copy and save the active sheet and rest can't. Hope you guys can help me.
This is the code
Sub SaveInvWithNewName()
Dim NewFN As Variant
ActiveSheet.Copy
NewFN = "D:\kashwin\SDMI-16-DO_" & Range("G13").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
End Sub
Thanks
Edit by Moderator: Moved from Testing sandbox to Excel Forum.