S
Susan Hayes
I have finished writing my program but need help in getting the data
into sheet2. In sheet1 a command button is supposed to have the user
select a file, have the data streamed to sheet2 and delimit it using
the comma.
So far I have this: (partly from vba help in excel and vba excel
book)
filetoopen = Application.getopenfilename("Data Files (*.asc),
*.asc")
Dim fs, f
Set fs = createobject("Scripting.filesystemobject")
set f = fs.opentextfile(filetoopen, 1, tristatetrue)
data = f.readall
with worksheets("sheet2").select
with data
.textfileparsetype=xldelimited
.textfilecommadelimiter=true
endwith
endwith
'data = f.readall
'worksheets("sheet2").select
'cells(1, "a")=data
The remarked above works but puts everything in cell A1.
Any help even to just stream the data to sheet2 is appreaciated. The
macro recorder is no help
The file being loaded has data from tests represent by each line
seperate by commas
ie
2,3,5.6, , 7 test1
4,7,4,8, , 10 test2 etc
Many Thanks
Susan
into sheet2. In sheet1 a command button is supposed to have the user
select a file, have the data streamed to sheet2 and delimit it using
the comma.
So far I have this: (partly from vba help in excel and vba excel
book)
filetoopen = Application.getopenfilename("Data Files (*.asc),
*.asc")
Dim fs, f
Set fs = createobject("Scripting.filesystemobject")
set f = fs.opentextfile(filetoopen, 1, tristatetrue)
data = f.readall
with worksheets("sheet2").select
with data
.textfileparsetype=xldelimited
.textfilecommadelimiter=true
endwith
endwith
'data = f.readall
'worksheets("sheet2").select
'cells(1, "a")=data
The remarked above works but puts everything in cell A1.
Any help even to just stream the data to sheet2 is appreaciated. The
macro recorder is no help
The file being loaded has data from tests represent by each line
seperate by commas
ie
2,3,5.6, , 7 test1
4,7,4,8, , 10 test2 etc
Many Thanks
Susan