Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi. I've been trying to automate exporting each worksheet in a workbook as a
separate CSV file. I've concocted my own macro by using the recorder and adapting several other macros I came across, but it doesn't work (I have to admit I'm not really familiar with VBA): Public Sub ExportAsCSV() ' ' ExportAsCSV Macro ' ' Dim Sh As Sheet ChDir "C:\Documents and Settings\trickster\My Documents\Voltec\" For Each Sh In Sheets ActiveSheet ActiveSheet.SaveAs Filename:="C:\Documents and Settings\trickster\My Documents\Voltec\", FileFormat:=xlCSV, CreateBackup:=False & Fname Sh.Save Next Sh Application.StatusBar = "All Sheets Saved." End Sub When I run this, I get Compile error: User-defined type not defined. Perhaps someone could help me get it working? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I export data from one worksheet to another? | Excel Discussion (Misc queries) | |||
Export Excel WorkSheet | Excel Discussion (Misc queries) | |||
Needed: worksheet export help | Excel Discussion (Misc queries) | |||
Export Worksheet to Access | Excel Programming | |||
Export Worksheet to Access | Excel Programming |