Excel Macro Help

B

bhbjk1

I am using Visual 6.5

I am trying to get my worksheet to find the match of a number in column SUPC
on workbook 1, in a SUPC column in workbook 2. When it finds that number, I
want to to return the number in Price column of workbook 2 into Cost column
on worksheet 1. I think it would go something like this

Workbook 1
A B C
SUPC LB/CS COST
4773214 LB
4937397 LB


Workbook 2
A B C D E F
SUPC ITEM # SIZE ITEM_DESCRIPTION CS Price
4773214 2911284 LB 12.45
4937397 2611212 LB 12.51

Can anyone help here.
 
M

Michael

In workbook 1 column where cost is type:
=vlookup(a2, Workbook2!$A$2:$F$1000,6,False)
This assumes that the price is in column F, change it to 5 if E to 4 if D
and so onif needed.
 
G

galimi

Jeff,

Seems like you would only need a VLOOKUP command for what you are looking to
do.
 
B

bhbjk1

For what I need workbook 1 for after it is finished, I can not have it linked
to another workbook. This is why I am trying to write a macro in workbook 2
which will fill in the cost column on workbook 1, with the price column in
workbook 2
 
M

Michael

After you have inserted the formula save it as a template, then do copy and
paste values into workbook1. Otherwise what you need is an Addin not just a
macro.
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.
 
B

bhbjk1

Save what as a template?
--
Jeff


Michael said:
After you have inserted the formula save it as a template, then do copy and
paste values into workbook1. Otherwise what you need is an Addin not just a
macro.
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.
 

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