VBA REQUIRED TO TAKE VALUE FROM EACH CELL FROM A RANGE AND FIND THE VALUE FROM A DIFFERENT RANGE

C

CAPTGNVR

DEAR ALL
In col.A have the needed tank numbers and groups. (2c, 5c, 3c say in
three cells and below 3c will be the group name 'fuel oil' in a4 and
so on for four or five group of tanks.

In col. D I have the tanks listed in order say about 20 tanks and in
col E, I have respective tank quantities.

What is needed is VBA code to take each cell value range in col. A
(range a1. a10) and check in range col.D (range d1.d20) and take the
value mentioned in col.E and place it in col.B.

I could do this but where I am finding difficulty is the minute the
cell value is a gropu name like "fuel oil" then i get error in find-
what.

So pls advice how to program so that if the match is not found to go
to the next cell of col.A and find for the value in col.D and take the
corresponding value from col.E and place it in col.B
 
S

Susan

Dear Captain -
just a side note - can you please not SHOUT your headers?
:)
thanks
susan
 
M

meh2030

DEAR ALL
In col.A have the needed tank numbers and groups. (2c, 5c, 3c say in
three cells and below 3c will be the group name 'fuel oil' in a4 and
so on for four or five group of tanks.

In col. D I have the tanks listed in order say about 20 tanks and in
col E, I have respective tank quantities.

What is needed is VBA code to take each cell value range in col. A
(range a1. a10) and check in range col.D (range d1.d20) and take the
value mentioned in col.E and place it in col.B.

I could do this but where I am finding difficulty is the minute the
cell value is a gropu name like "fuel oil" then i get error in find-
what.

So pls advice how to program so that if the match is not found to go
to the next cell of col.A and find for the value in col.D and take the
corresponding value from col.E and place it in col.B

It's not very clear as to what you are looking to do (or at least I'm
having trouble following). You might want to post some of the code
that you have already. Also, lookup the VLOOKUP Function in the Excel
Help. This may give you what you are looking for.

Matt
 

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