Output to CSV

  • Thread starter Thread starter sanjay
  • Start date Start date
S

sanjay

Hi,

Is there a way to create a macro to export a value (or even
worksheet) to a csv file.


I tried by creating a macro to save as a csv but this copies an
converts the current workbook to the new file type etc.

Any help would be welcome
 
It doesn't convert the source workbook unless you saveas with the same file
name. However,

You could always copy your sheet as a new workbook, saveas CSV, then close
it.

Activesheet.copy
Activeworkbook.Saves "C:\Myfolder\Myfile.csv", FileFormat:=xlCSV
Activeworkbook.close SaveChanges:=False
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top