Dilshan Anandan
New Member
- Joined
- Nov 14, 2018
- Messages
- 10
- Office Version
- 365
- Platform
- Windows
Hi All,
I am Trying to export a particular sheet to Text (Tab Delimited) File. The path to save the file and the name of the text file should be selected by the user.
I tried searching in internet and i am Fed up on this. I tried the below code but the whole workbook is getting saved in the selected path.
The Code I tried is -
Sub Savetxt()
Dim file_name As Variant
file_name = Application.GetSaveAsFilename(FileFilter:="Microsoft Excel file (*.txt), *.txt")
If file_name <> False Then
ActiveSheets.SaveAs Filename:=file_name
MsgBox "File saved!"
End If
End Sub
The text file getting saved is something like opening a excel file with text book.
If anyone could help on this, that would be great.
Thank you in advance
Dilshan
I am Trying to export a particular sheet to Text (Tab Delimited) File. The path to save the file and the name of the text file should be selected by the user.
I tried searching in internet and i am Fed up on this. I tried the below code but the whole workbook is getting saved in the selected path.
The Code I tried is -
Sub Savetxt()
Dim file_name As Variant
file_name = Application.GetSaveAsFilename(FileFilter:="Microsoft Excel file (*.txt), *.txt")
If file_name <> False Then
ActiveSheets.SaveAs Filename:=file_name
MsgBox "File saved!"
End If
End Sub
The text file getting saved is something like opening a excel file with text book.
If anyone could help on this, that would be great.
Thank you in advance
Dilshan