G
Guest
I have a macro that imports a txt file(test.txt) into an Excel spreadsheet and then I want to save this file with the same name as the txt file(test) obviously w/out the .txt. Any ideas? Thanks. Matt
and then I want to save this file with the same name as the txt file(test)Matt said:I have a macro that imports a txt file(test.txt) into an Excel spreadsheet
Excel spreadsheet and then I want to save this file with-----Original Message-----
I have a macro that imports a txt file(test.txt) into an
Dim MyFileName As String
MyFileName & ".txt"-----Original Message-----
Excel spreadsheet and then I want to save this file with
the same name as the txt file(test) obviously w/out
the .txt. Any ideas? Thanks. Matt
Dim MyFileName As String
MyFileName = "Your Text File Name"
'use the following name (using the appropriate code)
'to import text file
MyFileName & ."txt"
ActiveWorkbook.SaveAs FileName:="C:\" & MyFileName
& ".xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
.
Whoops that should be