turn on the macro recorder and then do file=OPen and select your file. go
through the text import wizard and select delimited and space as the
delimiter (or tab - whatever is appropriate).
Then, when the file is in, turn off the macro recorder.
This gives you the basic code you need.
If you want it in an existing sheet, then just use additional code like
Activesheet.UsedRange.copy Destination:= _
ThisWorkbook.worksheets(1).Range("A1")
ActiveWorkbook.Close Savechanges:=False
You can also modify the code to allow you to select a file by using
fName = Application.GetOpenfileName
then replacing the hard coded filename in the recorded code with fname
--
Regards,
Tom Ogilvy
"sreedhar" wrote in
message ...
hi
i want to copy data from text file to excel sheet
for ex
the data int the text file is
1 0 1 0 1
0 1 0 1 0
1 0 1 0 1
we have get this data into excel sheet like this
A B C D E
1 1 0 1 0 1
2 0 1 0 1 0
3 1 0 1 0 1
4
5
So,Plz help me regarding this
thanks
sree
--
sreedhar
------------------------------------------------------------------------
sreedhar's Profile:
http://www.excelforum.com/member.php...o&userid=27582
View this thread: http://www.excelforum.com/showthread...hreadid=476716