Exporting As CSV

NeedsHelp2

New Member
Joined
Nov 20, 2005
Messages
22
I've managed to find out how to export a worksheet as an excel file by searching past posts. What I would like to do is save it as either a CSV or text file. Despite having tried numeous ways I've failed and am once again seeking assistance.

This is the code that I'm currently using which allows you to save to your chosed directory:

Code:
    Dim MyName As String
    Dim LastRow As Long
    Dim MyFileName As String
    '==================Other Code
    Dim otlApp As Object, otlNewMail As Object
    Dim FileName As String, FSave, FName As String
    MyName = Format(Date, "yy mm dd") ' & ".xls"
    FSave = Application.GetSaveAsFilename(InitialFileName:=Sheets("sheet1").Range("D3").Value & " Backup " & MyName)
    If TypeName(FSave) = "Boolean" Then Exit Sub
    If Mid$(FSave, Len(FSave), 1) = "." Then
        FSave = Mid$(FSave, 1, (Len(FSave) - 1))
        End If
    FName = Right(FSave, Len(FSave) - InStrRev(FSave, "\"))
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,223,226
Messages
6,170,845
Members
452,361
Latest member
d3ad3y3

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