View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Import a comma delimited file & match records

It happens that Dave formulated :
Code1,Code2,YR,MM,CoName,Dept_name,Quantity,$amoun t


Is this the first line in the file. If so then I suggest using ADO to
grab the data into recordset[s] and write the appropriate values to
your worksheet. Each recordset could be unique for each Code# pair, OR
you could process each record of a recordset containing all data in the
file.

If the field names are not the first line in the file then this can be
prepended (via VB file I/O functions) so ADO knows what these field
names are.

Just curious.., why do you not copy the 2 Code# when copying the other
data? How do you handle a new month entering the first data onto its
sheet?

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc