ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   output text (https://www.excelbanter.com/excel-programming/294655-output-text.html)

ktokuo

output text
 
I am trying to output the text in excell cells

For example how do you output text fil

A B
1 2 Hell
2 5 H
3 28 Goo

How can I output a tex file containing B1 with th
file title of A1. I also want to make separate tex
files for each row

Any advice of Help would be appriciatte

Thank

Kuni

Rob van Gelder[_4_]

output text
 
Sub test()
Const cPath = "C:\T\"
Dim i As Long, lngLastRow As Long
Dim intFreeFile As Integer

With ActiveSheet
lngLastRow = .Cells(Rows.Count, 1).End(xlUp).Row

For i = 1 To lngLastRow
intFreeFile = FreeFile
Open cPath & .Cells(i, 1).Value For Output As #intFreeFile
Print #intFreeFile, .Cells(i, 2).Value
Close #intFreeFile
Next
End With
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"ktokuo" wrote in message
...
I am trying to output the text in excell cells.

For example how do you output text file

A B
1 2 Hello
2 5 Hi
3 28 Good

How can I output a tex file containing B1 with the
file title of A1. I also want to make separate text
files for each row.

Any advice of Help would be appriciatted

Thanks

Kuni





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com