how to create a macro/vba to read an text file and filled colluns on excel+vloockp

E

EHM

HI all
I know nothing about macros or vba for excel, but I think what I need
should be not that difficult.
I have an TXT file like this:

idnumber, year, quarter, program, duration, coutry
8888, 2004, winter, intensive, 10, brazil
8887, 2004, winter, intensive, 10, mexico
8889, 2004, winter, intensive, 10, china
8884, 2004, summer, intensive, 04, japan
8883, 2004, spring, conversat, 03, japan
8880, 2003, fall, gbm, 10, france

and so on.

then I have this excel spreadshet, one for each year, then each
spreadshet has many tabs workshet, one for each program (intensive,
conversat, gbm, etc)
Each workshet has all contries on the colum A1-A146
What I need is a script who does this:
1) open the TXT file and start reading line by line
2) read one line, and pick the "year". Then open the spreadsheet
ABC_'year', where 'year' is the 4 digits for that year
3) read the same line and pick the "program" + "duration". then open
the worksheet "program duration" (will be named like 'intensive 10',
'intensive 04', 'conversation 10', 'conversation 03' and so on)
at this point I will have the annual spreadsheet, oppend in the
correct program+duration worksheet.
4) then I have to read the quarter (winter, summer, spring, fall) and
I will sellect the column from that: winter = colum C, spring = conlum
F, summer = colum H, fall=colum K).
5) then I will have to hlookup the country. Since I already have ALL
countries on my spreadsheet (colum A1-A146), I have to find which row
has the country I'm reading now from the TXT file.
6) Once I find the right row, then I have to ADD+1 to the content of
that row.

As I told, I know nothing about programing, but I'm a fast learning if
I can have one example on how to do it.

Could any one help me finding a script who can do it more or less?
Thank you
EHM
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top