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

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,624
Messages
5,832,742
Members
430,160
Latest member
a_majda

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
Top