output text

K

ktokuo

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
 
R

Rob van Gelder

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
 
Top