Save In Different Format

BluesBros

New Member
Joined
Jan 16, 2005
Messages
42
I'm currently creating a file which is named as an excel file. How can I amend the code below so that is saved as a text or CSV file?

MyName = Format(Date, "dd mm yy")
FSave = Application.GetSaveAsFilename(InitialFileName:=Sheets("sheet5").Range("D2").Value & " Backup Dated " & MyName)
If TypeName(FSave) = "Boolean" Then
Application.DisplayAle
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Here is some code that I use to save files as space delimited text files (prn). See if this helps:
Code:
'   Save file
    Dim mySaveFile As String
    MsgBox "You will now be prompted to save the file" & vbCrLf & _
           "Please select the appropriate drive and name you would like to give the file"
'   Prompt for new file name
    mySaveFile = Application.GetSaveAsFilename("MyFile.prn", "Formatted Text (space delimited) (*.prn), *.prn")
'   Save as a formatted text file
    ActiveWorkbook.SaveAs Filename:=mySaveFile, FileFormat:=xlTextPrinter
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,561
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top