VBA Code To Export To .CSV File Type

kkoruni

New Member
Joined
Jul 18, 2017
Messages
23
Hello,
The goal is to export an excel tab into a .csv fyle type, and then user can save this .csv file type with a name they choose. If this is not possible, then is there an automatic way to same to .csv file type based on file name that exporting tab came from? I have watched many videos but I got my head spinning. Any help is greatly appreciated.

I am in need of your help with below vba. I am able to export tab with ease.
However, I want to be able to export it as .csv file type. Is there a vba code that allows me to export as .csv excel file type? If no, then is there a way to export and automatic save as .csv file type on a desktop folder?

Private Sub CommandButton1_Click()
Sheets("PROF_Data_Capture").Select
ActiveSheet.Unprotect
Sheets("PROF_Data_Capture").Copy
Application.Range("A1:B36").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CommandBars("Control Toolbox").Visible = True
ActiveSheet.Shapes("CommandButton1").Select
Application.CutCopyMode = False
Selection.Delete
Application.CommandBars("Control Toolbox").Visible = False
Application.Range("A1").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Forum statistics

Threads
1,223,910
Messages
6,175,316
Members
452,634
Latest member
cpostell

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