#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default declaring

Pulled the part about this from help
With 'FreeFile 'FF 'MyFile
.TextFileParseType = xlDelimited
.TextFileCommaDelimiter = True
.Refresh
End With
Trying to get code to accept I am doing something wrong not sure what.
Object her is to put two commas into seperator as word odesnot want to accept
only one as text file now has. Following is what I have done to wit
Thanks to All

Dim FF As Long
Dim RowCount As Long
Dim ColCount As Long
Dim TotalFile As String
Dim MyFile As String
' Set myfile = "C:\Parade\ZZZ.txt" 'myfile = "c:\parade" & "mine.txt"
' Dim TotalFile As TextStream
'dim #FF as Variable
MyFile = "C:\Parade\zzz.txt"
FF = FreeFile
Open "C:\Parade\ZZZ.txt" For Output As #FF
For RowCount = 1 To Cells(Rows.Count, "A").End(xlUp).row
If WorksheetFunction.CountBlank(range("a" & RowCount & ":e" &
RowCount)) = 0 Then
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
End If
' Next
' With MyFile
' .TextFileParseType = xlDelimited
' .TextFileCommaDelimiter = True
' .Refresh
' End With
Dim Blanks As Long
Dim LastRow As Integer
Blanks = msgbox(Prompt:="Do you have blanks to complete?,If not sure
Click on Yes", Buttons:=vbYesNo)
If Blanks = vbYes Then
LastRow = Cells(Rows.Count, "A").End(xlUp).row
range("D5:M5").Resize(LastRow - 4).Select
Userform1_Main_form.Hide
Selection.specialcells(xlCellTypeBlanks).Select
End If
If Blanks = vbNo Then
With 'FreeFile 'FF 'MyFile
.TextFileParseType = xlDelimited
.TextFileCommaDelimiter = True
.Refresh
End With
End If
Print #FF, TotalFile
Close #FF
End Sub

Reply
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
Declaring arrays DKS Excel Programming 4 February 13th 08 09:15 PM
declaring a certain value thephoenix12[_4_] Excel Programming 2 June 28th 05 02:31 PM
declaring a msgbox Tracey[_6_] Excel Programming 2 May 12th 04 04:43 PM
Declaring arrays Alan Beban[_2_] Excel Programming 22 May 12th 04 08:10 AM
Declaring a DLL Erich Neuwirth Excel Programming 1 May 10th 04 06:27 PM


All times are GMT +1. The time now is 06:38 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"