output text

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top