Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i remove these square blocks in my txt file

Status
Not open for further replies.

smcmanus

Technical User
Aug 1, 2001
25
CA
Here is my code:

Do While test_cell <> &quot;&quot;
Print #filenum, Worksheets(wrksht_in).Cells(x, 1).Value & &quot;,&quot;; vbBack;
test_cell = Worksheets(wrksht_in).Cells(x, 2).Value
x = x + 2
Loop


Result:
001001,001002,001003,001011,001012,001021,001022,
 
The box is your text editor's interpretation of the vbBack character.. the vbBack's Ascii equivalent. What are you trying to accomplish with the vbBack character?
 
What is happening is if i do not put in the &quot;vbback&quot; it looks like this:
001001,
001002,
001003,
001011,
001012,
001021,
001022

I need it to be all on one line like this:
001001,001002,001003,001011,001012,001021,001022,

Thanks
 
Print automatically put a CR at the end of the line. Why don't you try using Put #filenum Swi
 
In had trouble with the Operator pressing enter in the Notes Section of a program and was able to take out the New line feed with chr$(13) with the following procedure. The Notes were in a Memo field with various character length. I have changed this to the vbback code which is Chr$(8)This might work for you. (I hope)

'consolidate the notes into one string
'
Dim sInput As String
Dim nFindPos
sInput = Trim(.Notes) 'notes had using the With ???
'
'Replace vbback with space
'
nFindPos = 0
Do
nFindPos = InStr(sInput, Chr$(8)) 'chr$ 8 is vbback
if finddPos > 0 Then Mid(sInput, nFindPos) = &quot; &quot;
Loop Until nFindPos = 0

sInput should then contain the file without the vbback.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top