Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default export excel colonm to a single text file

hello,

I try to export data from excel file, i would like to export multiple
colonm, each colonm in a separate text file with. Is it possible to
specify the names of the export file in the first row of each colonm

thank you very much for your help

Phil
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default export excel colonm to a single text file

Hi Phil:

Here is some sample data for columns A thru C:

c:\test\birds.txt c:\test\animals.txt c:\test\flowers.txt
sparrow dog rose
robin cat lily
quail mouse violet
hawk flea snapdragon
rat
elephant
moose


The first row is the full filespec (path & name). Here is a very simple
macro:

Sub Column2File()
' gsnuxx
Set fs = CreateObject("Scripting.FileSystemObject")
For i = 1 To 3
n = Cells(Rows.Count, i).End(xlUp).Row
fspec = Cells(1, i).Value
Set a = fs.CreateTextFile(fspec, True)
For j = 2 To n
a.WriteLine (Cells(j, i).Value)
Next
a.Close
Set a = Nothing
Next
Set fs = Nothing
End Sub
--
Gary''s Student - gsnu2007k


" wrote:

hello,

I try to export data from excel file, i would like to export multiple
colonm, each colonm in a separate text file with. Is it possible to
specify the names of the export file in the first row of each colonm

thank you very much for your help

Phil

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to export large amounts of text data into single reports Wayne Excel Discussion (Misc queries) 1 May 23rd 08 11:44 PM
How can I export text from excel autoshapes to a text file? Donncha Excel Discussion (Misc queries) 0 July 20th 06 04:58 PM
Cell export to Text File? Steve Excel Discussion (Misc queries) 3 December 7th 05 03:13 PM
export excel file as csv with text delimiter of " John Excel Discussion (Misc queries) 2 May 12th 05 05:50 PM
Export excel file to semicolon delimited text file capitan Excel Discussion (Misc queries) 5 April 7th 05 03:06 AM


All times are GMT +1. The time now is 05:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"