Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Import a comma delimited file & match records

I am on Excel 2003,. I have a spreadsheet with 12 monthly tabs one for
every month of the year January, February … December.. This file is
called montly_totals.xls and is located in P:\DAM\WI_FTP. There are a
total of 200 accounts set up in each of these monthly tabs. Each of
these accounts starts with a code in A1 & B1 . These are 4 character
codes like below:

Code1 Code2

0845 MTRA
1016 BBBB
1017 LEGL
1605 1605
1605 OSLA
7777 0001
7777 0002


Every month I download a comma delimited file named as WI_JAN_2011,
WI_FEB_2011 and so on till WI_DEC_2011. This file is located in P:\DAM
\WI_FTP This file may contain 10 to 150 accounts with updated
information for that specific month. They also have the same codes as
above. The format of the comma delimited file is :

Code1,Code2,YR,MM,CoName,Dept_name,Quantity,$amoun t
0010,BBBB,11,01,Iron works ,Grills ,
000000130,0000003448635,

Currently every month I have to open each monthly tab and manually
copy and paste the correct Information from the comma delimited file
into the exact columns in my montly_totals.xls spreadsheet. The
columns I copy are : YR,MM,CoName,Dept_name,Quantity,$amount

I want a macro that would read this comma delimited file and insert
these new monthly updated values to the correct account numbers.
I was thinking that it could key on Code1 & Code2 fields. Once there
is a match between the codes i.e Code1+Code 2 in the montly_totals
spreadsheet and the comma delimited file than the macro could insert
the complete record (YR,MM,CoName,Dept_name,Quantity,$amount ) into
seperate cells in the montly_totals.xls.

Thanks in advance,
Dave
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 91
Default Import a comma delimited file & match records

If possible pls send me one sample monthly file and one consolidated
file.
  #3   Report Post  
Posted to microsoft.public.excel.programming
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Import a comma delimited file & match records

Javed, I am sorry I can not load the file to big and contains info I
can not load.

Gary,

No that is not the first line of data I was trying to show what the
data lebels were.
the .csv file just contains row after row of data like
0010,BBBB,11,01,Iron works ,Grills ,
000000130,0000003448635
Each code pair is unique.
So far I have been manuall copying and pasting the data. I entered the
initial 200 codes by hand & now I want to be able to compare and
insert the updated values in a macro,

thanks in advance again.

On Feb 15, 10:03*am, GS wrote:
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 athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Serial comma delimited text - Import to XL evry 8th comma nuRow Billp Excel Programming 30 June 23rd 09 11:51 PM
Comma Delimited, saving of records - CSV File Paul Bytes Excel Discussion (Misc queries) 1 January 26th 07 01:55 PM
Import comma delimited text Lin Excel Discussion (Misc queries) 3 July 28th 06 04:07 PM
Import Comma delimited info in a Column Burger23 Excel Worksheet Functions 10 March 6th 06 03:48 AM
I have a Comma delimited text file how do I import in to excel an. trevord Excel Discussion (Misc queries) 1 February 3rd 05 11:41 PM


All times are GMT +1. The time now is 11:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"