Thread: build text file
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Curt Curt is offline
external usenet poster
 
Posts: 469
Default build text file

Have the following that creates a text file. Problem it does use th entire
sheet that has data. Is it possible to have it only use those rows that are
complete. Here is what I've got.
Thanks to all


Dim FF As Long
Dim RowCount As Long
Dim ColCount As Long
Dim TotalFile As String
' Dim TotalFile As TextStream
FF = FreeFile
Open "C:\Parade\ZZZ.txt" For Output As #FF
For RowCount = 1 To Cells(Rows.Count, "A").End(xlUp).row
If RowCount 1 Then TotalFile = TotalFile & vbCrLf
For ColCount = 1 To Cells(RowCount, Columns.Count).End(xlToLeft).Column
If ColCount 1 Then TotalFile = TotalFile & ","
TotalFile = TotalFile & Cells(RowCount, ColCount).Value
Next
Next
Print #FF, TotalFile
Close #FF