ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Macro Help (https://www.excelbanter.com/excel-programming/420333-excel-macro-help.html)

bhbjk1

Excel Macro Help
 
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.

--
Jeff

Michael

Excel Macro Help
 
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.
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"bhbjk1" wrote:

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.

--
Jeff


galimi

Excel Macro Help
 
Jeff,

Seems like you would only need a VLOOKUP command for what you are looking to
do.
--
http://HelpExcel.com




"bhbjk1" wrote:

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.

--
Jeff


bhbjk1

Excel Macro Help
 
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
--
Jeff


"bhbjk1" wrote:

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.

--
Jeff


Michael

Excel Macro Help
 
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.




"bhbjk1" wrote:

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
--
Jeff


"bhbjk1" wrote:

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.

--
Jeff


bhbjk1

Excel Macro Help
 
Save what as a template?
--
Jeff


"Michael" wrote:

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.




"bhbjk1" wrote:

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
--
Jeff


"bhbjk1" wrote:

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.

--
Jeff


bhbjk1

Excel Macro Help
 
I am wondering if something like this would work?
--
Jeff


"bhbjk1" wrote:

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.

--
Jeff



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com