First, I would like to thank anyone who can possibly assist me with the VBA for this spreadsheet.
The worksheet consists of 10 columns (A-J) and 13 rows (1-13). The first row is a header row that contains eight codes that I need to look up the value in a table and multiple it by the count in each of the cells below. The result of the vlookup for each column needs to be added together and return a total in column J. I have a formlua that works well, however, I would like to convert the formula to VBA and For Each loops confuse me every time. The formula is:
=SUM(VLOOKUP(B$1,$P$2:$Q$9,2,FALSE)*B2,VLOOKUP(C$1,$P$2:$Q$9,2,FALSE)*C2,VLOOKUP(D$1,$P$2:$Q$9,2,FALSE)*D2,VLOOKUP(E$1,$P$2:$Q$9,2,FALSE)*E2,VLOOKUP(F$1,$P$2:$Q$9,2,FALSE)*F2,VLOOKUP(G$1,$P$2:$Q$9,2,FALSE)*G2,VLOOKUP(H$1,$P$2:$Q$9,2,FALSE)*H2,VLOOKUP(I$1,$P$2:$Q$9,2,FALSE)*I2)
A sample workbook is attached.
Any help is greatly appriciated.
Thank you,
Eric
Bookmarks