I have written a code which opens a text file, puts the text in columns, and formats certain cells, then saves the file as an excel type file. At the end of this code, I want to open a saveas dialog box and automatically put the name of the file in the FileName box. However, when I do this, it puts the file as " "filename.txt" " in the file name box. I want it to just say " filename ".
Here's the code....
FName = Application.GetOpenFilename("Text Files (*.txt), *.txt")
If FName <> False Then
Workbooks.OpenText Filename:= _
FName, Origin:=xlWindows, _
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=False _
, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1), _
Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), Array(9, 1), _
Array(10, 1), Array(11, 1), Array(12, 1))
ElseIf FName = Flase Then
End
End If
<Here is where I put all the code for the formatting>
fileSaveName = Application.GetSaveAsFilename( _
InitialFilename:=FName, _
fileFilter:="Microsoft Excel Files (*.xls), *.xls")
If fileSaveName <> False Then
ActiveWorkbook.Save
ElseIf fileSaveName = False Then
End If
.....
Does anyone know what I'm doing wrong?
Bookmarks