Export Specified Sheets to .csv file

cow1234

New Member
Joined
Feb 28, 2014
Messages
2
Long time reader, first time poster.

I am trying to create vba code that will allow me automatically export four different sheets in an excel workbook (.xlsm file to be exact) named, for example, SheetA, SheetB, SheetC, SheetD to individual .csv files saved automatically always on the desktop (and to replace any existing files of the same name). I would like the .csv files to be named after their sheet name.

I have searched tirelessly with no success. My problem when I try to record the macro (which I often do b/c of little coding experience) is that File > Save as... .csv changes my .xlsm file to the .csv and it just gets all messed up. So I am looking for something that will save these four sheets in the background without actually opening the .csv files.

Any suggestions?<textarea id="adlesse_unifier_magic_element_id" style="display: none;"></textarea>
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Welcome to the Board!

Why not store/run the code from a different Excel workbook?
If you open a new blank workbook, turn on the Macro Recorder, then open the file file you want, and save each sheet to a separate CSV, it should give you most of the code you need.
 
Upvote 0
That has potential, but creates another problem in that this file gets copied every month and changes files name. Is there anyway I could select the specific file to open in the new blank workbook?

I just have to make the solution as easy as possible for my end users (which are less computer literate than me).<textarea id="adlesse_unifier_magic_element_id" style="display: none;"></textarea>
 
Upvote 0

Forum statistics

Threads
1,215,982
Messages
6,128,105
Members
449,421
Latest member
AussieHobbo

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