Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: writing text files with vb
06-25-2009, 12:12 PM #1
- Join Date
- Jun 2009
- Thanked 0 Times in 0 Posts
writing text files with vb
I learned how to create a text file and how to write in it using vb. however all the methods i've seen write my text on different lines.
What i have exactly is an excel sheet and on command i need to copy the data from the excel sheet to a text file.
the sheet on the form is S1.
the code i'm using is
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objfile = objFSO.CreateTextFile("C:\poudyn.txt")
objfile.Write S1.Cells(1, 1)
objfile.Write S1.Cells(3, 4)
what i need is to write the content of these 2 cells on the same line
eg : if S1.Cells(1, 1) = 1
and S1.Cells(3, 4) = 6
i want to write in the text file on a line 1 6
if anyone has any idea about how to do that i'd be very very very gratefull.
thanks in advance