Excel VB or linking a database(if poss)? getting product names from their codes

F

F_lemieux38

This is a bit long but i'll be very grateful for any help:
Ok, i'm working for a big company, and once a month we receive a hug
excel spread sheet full of raw data, Which contains, fields such a
customer, salesman, product number etc, which i then have to sort out
and make sub totals. But firstly i have to create a few more fields t
lump this data up, like Product group and Sub catagory. This is wher
the problem lies, Product group is not so bad because i can copy th
product code column and use the find-replace function, which doesn'
take so long. However the find-replace function for sub-cat is tediou
and long. So what i'm wanting to do is either have a VB program wit
all the names of the sub-cat for each product code, i would only hav
to write the program once, and be able to use a sort of =subcat(B12
sort of function and drag it down for all the cells. But i'm not sur
how visual basic works, i have done a little programming, C++, and i
there was a IF, DO, Else Function for example:
First of all read the no. in the cell specified for instance as above
in cell B12 then:
If ("LTM0102");
Do printf ("Spare-parts")
Else IF (..........etc. (i know this is wrong but u get the idea)
obviously this is a long process but i'll only have to be done once
and every time there is a new product it'll just have to be added t
the program.
Or what would be easier is to make a database and then be able t
retreive the sub-cat name, from the correct record using the produc
no. as a pointer, and then the database would have to be made only onc
and updated when necessary?
but of course i don't know how to do this, anybody have any ideas
they'll be well appreciated, thanks for your time, i know this is
long thread.
Any suggestions
 
B

BrianB

I think a simple lookup table would do the job - with codes in lef
column and sub cat in right.
Use the =VLOOKUP() function (see Excel Help)
 
F

F_lemieux38

Thanks, i thought there might be a simpler way, i'll give that a go, i
did seem a bit complicated what i was trying to d
 

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