Hello , I hope that someone can help me whit this ?
I"m searching for days now !
"
I would like to save a file with the filename selected in cel "d14" and "h9 " ,but I want to choose the path myself .For example : c:\test\
It's every time a different path !
where must i put this code ? ' Application.GetSaveAsFilename '(or something)
Tnx
Code i'm using :
Dim fName As String, FileNm As String
'GET THE NEW FILENAME FROM THE CURRENT SHEET
FileNm = ActiveSheet.Range("D14").Value & ActiveSheet.Range("H9").Value
fName = ActiveWorkbook.Path & "\" & FileNm & ".xls"
Debug.Print fName
'IF THE FILE ALREADY EXISTS THEN DELETE IT ---------------------------------*
If Dir(fName) <> "" Then Kill fName
'COPY THE WORKSHEET
ThisWorkbook.ActiveSheet.Copy
'SAVE THE NEW WORKBOOK
ActiveWorkbook.SaveAs Filename:=fName
ActiveWorkbook.Close
I"m searching for days now !
"
I would like to save a file with the filename selected in cel "d14" and "h9 " ,but I want to choose the path myself .For example : c:\test\
It's every time a different path !
where must i put this code ? ' Application.GetSaveAsFilename '(or something)
Tnx
Code i'm using :
Dim fName As String, FileNm As String
'GET THE NEW FILENAME FROM THE CURRENT SHEET
FileNm = ActiveSheet.Range("D14").Value & ActiveSheet.Range("H9").Value
fName = ActiveWorkbook.Path & "\" & FileNm & ".xls"
Debug.Print fName
'IF THE FILE ALREADY EXISTS THEN DELETE IT ---------------------------------*
If Dir(fName) <> "" Then Kill fName
'COPY THE WORKSHEET
ThisWorkbook.ActiveSheet.Copy
'SAVE THE NEW WORKBOOK
ActiveWorkbook.SaveAs Filename:=fName
ActiveWorkbook.Close