Hi,
I have a script that takes a sheet from the current workbook puts it into a new workbook then converts all the data into values and then saves it as a specific name.
It currently saves the new workbook to the 'my documents' folder but I want to save it in the same location as the workbook which contained the original macro.
how do I do this?
many thanks
I have a script that takes a sheet from the current workbook puts it into a new workbook then converts all the data into values and then saves it as a specific name.
It currently saves the new workbook to the 'my documents' folder but I want to save it in the same location as the workbook which contained the original macro.
how do I do this?
Code:
Sub ZCRM()
Dim Fname As String
Fname = Sheets("ZCRM_PROD_SELECT").Range("A1").Value
Sheets("ZCRM_PROD_SELECT").Copy
With ActiveWorkbook
Range("A1:k3000").Select
Selection.Copy
Range("a1").Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Range("A1").Select
Application.CutCopyMode = False
.SaveAs Filename:="ZCRM.xls"
.Close
End With
End Sub
many thanks