carlleese24
Board Regular
- Joined
- Mar 15, 2005
- Messages
- 108
Hi
I have 2 sheets one is called the price file which has the following columns
Customer (Col A)
Material (Col B)
Price (Col C)
Currency (Col D)
Start date (Col E)
End date (Col F)
The 2nd called the invoice details which has the following columns
Bill Doc (Col A)
Item (Col B)
Material (Col C)
Material number (Col D)
Created on (Col E)
Invoiced quantity (Col F)
SU (Col G)
Net Value (Col H)
Currency (Col I)
Price (Col J)
Customer (Col K)
I have a formulae in column L
=SUMPRODUCT(--('price File'!$B$2:$B$11='Invoice Details'!E2),--('Invoice Details'!G2<=('price File'!$F$2:$F$11)),--('Invoice Details'!G2>='price File'!$E$2:$E$11),('price File'!$C$2:$C$11))
What this formulae does is takes the date and the material code on the invoice details sheet and then looks through the list on the price file sheet and if the date is within the start and end date and matches the material code on a particular row it will then take the price on that row.
and also another one in column M
=SUMPRODUCT(--('price File'!$B$2:$B$11='Invoice Details'!E2),--('Invoice Details'!G2<=('price File'!$F$2:$F$11)),--('Invoice Details'!G2>='price File'!$E$2:$E$11),('price File'!$A$2:$A$11))
What this formulae does is takes the date and the material code on the invoice details sheet and then looks through the list on the price file sheet and if the date is within the start and end date and matches the material code on a particular row it will then take the customer name on that row.
I would to convert this process into a VBA code somehow so it makes the process faster as I will have thousands of rows
Please could anyone help me to make this possible.
Carl
I have 2 sheets one is called the price file which has the following columns
Customer (Col A)
Material (Col B)
Price (Col C)
Currency (Col D)
Start date (Col E)
End date (Col F)
The 2nd called the invoice details which has the following columns
Bill Doc (Col A)
Item (Col B)
Material (Col C)
Material number (Col D)
Created on (Col E)
Invoiced quantity (Col F)
SU (Col G)
Net Value (Col H)
Currency (Col I)
Price (Col J)
Customer (Col K)
I have a formulae in column L
=SUMPRODUCT(--('price File'!$B$2:$B$11='Invoice Details'!E2),--('Invoice Details'!G2<=('price File'!$F$2:$F$11)),--('Invoice Details'!G2>='price File'!$E$2:$E$11),('price File'!$C$2:$C$11))
What this formulae does is takes the date and the material code on the invoice details sheet and then looks through the list on the price file sheet and if the date is within the start and end date and matches the material code on a particular row it will then take the price on that row.
and also another one in column M
=SUMPRODUCT(--('price File'!$B$2:$B$11='Invoice Details'!E2),--('Invoice Details'!G2<=('price File'!$F$2:$F$11)),--('Invoice Details'!G2>='price File'!$E$2:$E$11),('price File'!$A$2:$A$11))
What this formulae does is takes the date and the material code on the invoice details sheet and then looks through the list on the price file sheet and if the date is within the start and end date and matches the material code on a particular row it will then take the customer name on that row.
I would to convert this process into a VBA code somehow so it makes the process faster as I will have thousands of rows
Please could anyone help me to make this possible.
Carl