View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default Macro that stores all sheets as tab-delimited text files

Hi!
I'm trying to write an macro that converts one single xls-file
to multiple text file (tab delimited) with filenames corrsponding to
the names of the sheets.

How to do that?

I recorded my actions:
Sub GemAsTxt()
ActiveWorkbook.SaveAs Filename:= _
"H:\Develop\work\TestData\Testmodel.txt", FileFormat:= _
xlText, CreateBackup:=False
End Sub

But what I need is:
Sub GemAsTxt()
for all sheets:
ActiveWorkbook.SaveAs Filename:= _

"<directoryOfCurrentExcelFile\<excelfileWithoutFi leType\<sheetname",
FileFormat:= _
xlText, CreateBackup:=False
End Sub