Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel - Export cells into .txt file

Status
Not open for further replies.

pho01

Programmer
Mar 17, 2003
218
US
I have a spreadsheet with thousand of rows. I combine values of all columns of each row into one column K.

Now I want to export each row of column K into a text file.
For example:

Sheet1.Cells(1,"K").value => C:\temp\1.txt
Sheet1.Cells(2,"K").value => C:\temp\2.txt
Sheet1.Cells(3,"K").value => C:\temp\3.txt

How can I do that with xcel macro?

Thanks!

 




Hi,

You want ONE ROW in each text file?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Something like:
Code:
    Dim FileNum             As Long
    FileNum = FreeFile
    Open "C:\temp\1.txt" For Append As #FileNum
    Write #FileNum, Sheet1.Cells(1,"K").value 
    Close #FileNum

good luck

Never knock on Death's door: ring the bell and run away! Death really hates that!
 
Thanks ClulessChris. It worked
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top