View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Nazrul Nazrul is offline
external usenet poster
 
Posts: 3
Default Read data from ascii file

I'd like to read a ascii file using VBA and the file has
(for example):
------------------------------------------------
Name Group Measured Modelled
d311 obsgroup 0.3270859 0.2853140
d312 obsgroup 0.3436139 0.3403970
--------------------------------------------------------
I have written:
dim dataname, groupname as string
Dim meas, modell as double

Line Input #1, textline ' Read text line
Do While Not EOF(1) ' Loop until end of file.
Input #1, dataname, groupname, meas, modell
Count = Count + 1
Loop
*******
But the variables does not read correctly. Could you help
me?

Nazrul