assuming you list of wood is in column J and this cantains all unique timbers from your list.
this should do what you require
if you want it output into a different sheet, let me know what the sheet name is.Code:Sub total() lr = Range("A" & Rows.Count).End(xlUp).Row lr1 = Range("J" & Rows.Count).End(xlUp).Row For a = 1 To lr1 total = 0 word1 = Range("j" & a) For i = 2 To lr If Range("C" & i) = word1 Then total = total + Range("B" & i) * Range("E" & i) Next Range("k" & a) = total Next End Sub
Only thing i was not sure about was if you required the code to pull out all of your unique timbers from the list??