LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default Need help combining

First go at creating and writing to text file. Having read copy paste not way
to go. Found code that will create text file in help. Also searched and found
code that will write all data and not write blank rows or cells. Having a
problem bringing the code together. Also have had method or data member not
found show up on .CreateTextFile & .writeline Output. Once I get this
combined can move on.
Will enclose the code I have in place.
Thanks to All

Sub AAAA()
Dim lastrow As Variable
Dim RowCount As Integer
Dim lastcol As Variable
Dim ColCount As Integer
Dim OutPutLine As Variable
Dim Delimiter As Variable
Dim tswrite As Variable
Dim writeline As String
Dim FSO As Scripting.FileSystemObject
Dim AAA As Scripting.TextStream
Set FSO = New Scripting.FileSystemObject
Set AAA = FSO.CreateTextFile("C:\Parade\ZZZ.txt")
AAA.writeline "This Is Line One"----This part works fine as is
'Worksheets("mailE").Activate

lastrow = Cells(Rows.Count, "A").End(xlUp).row
For RowCount = 1 To lastrow
lastcol = Cells(RowCount, Columns.Count).End(xlToLeft).Column
For ColCount = 1 To lastcol
If ColCount = 1 Then
OutPutLine = Cells(RowCount, ColCount)
Else
OutPutLine = OutPutLine & Delimiter & Cells(RowCount, ColCount)
End If

Next ColCount
OutPutLine = Trim(OutPutLine)
If Len(OutPutLine) < 0 Then
tswrite.writeline OutPutLine ---this is writeline hang up.
CreateTextFile is in another module had to set reference to get first part to
operate may need to set more thanks again---
End If
Next RowCount

End Sub


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining second row to first row LisaJ27 Excel Discussion (Misc queries) 2 February 26th 09 03:48 PM
Combining Tamsin Charts and Charting in Excel 0 March 5th 07 03:14 PM
Combining look up and last? Sarah Excel Discussion (Misc queries) 4 January 9th 07 10:01 AM
Combining Sum, IF and AND Kenton_SJ Excel Discussion (Misc queries) 1 August 3rd 05 11:30 PM
combining IF and AND Dahlman Excel Discussion (Misc queries) 5 May 12th 05 08:21 PM


All times are GMT +1. The time now is 04:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"