M
muybn
I'm trying to do a VB command that will replace all instances of "," with a
tab in a text file. My code is:
Sub test()
Dim strScrap As String, strRepl As String, intCt As Integer, arrText As
Variant
strRepl = Chr(34) & Chr(44) & Chr(34)
Open "C:\directory\file" For Input As #1
Do While InStr(strScrap, strRepl) > 0
Line Input #1, strScrap
arrText = Replace(strScrap, strRepl, Chr(9))
Loop
Close #1
End Sub
When I execute it, however, I find instr = 0 but the file is full of this
text. What am I missing?
tab in a text file. My code is:
Sub test()
Dim strScrap As String, strRepl As String, intCt As Integer, arrText As
Variant
strRepl = Chr(34) & Chr(44) & Chr(34)
Open "C:\directory\file" For Input As #1
Do While InStr(strScrap, strRepl) > 0
Line Input #1, strScrap
arrText = Replace(strScrap, strRepl, Chr(9))
Loop
Close #1
End Sub
When I execute it, however, I find instr = 0 but the file is full of this
text. What am I missing?