LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
EHM EHM is offline
external usenet poster
 
Posts: 2
Default how to create a macro/vba to read an text file and filled colluns on excel+vloockp

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
 
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
Create read-only Excel file 2007 Mary Ann Excel Discussion (Misc queries) 1 November 19th 09 06:05 PM
How do you save an excel file to be read as IBM-type text file ? Dee Franklin Excel Worksheet Functions 2 October 10th 06 02:46 AM
excel - create a macro to use cell text as part of a file name bossman tv New Users to Excel 1 June 27th 06 10:38 PM
create excel spreadsheet to display data from filled text forms pluck4me Excel Discussion (Misc queries) 0 April 20th 05 08:37 PM
Read Text File into Excel Using VBA Willie T Excel Discussion (Misc queries) 13 January 8th 05 12:37 AM


All times are GMT +1. The time now is 12:00 AM.

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

About Us

"It's about Microsoft Excel"