I have tried the same and madw this code but some error is there. Cn someone please modify it to suit the requirement?
I have removed the subtotals.
Inserted a new row in Sheets Summary at Row 3.
Now I am running the following code:
Sub MakeSumm()
Dim Fbthoe As String
Dim Qtr As String
Dim urows As Double
Dim Total As Double
Dim j As Double
Dim i As Double
Dim q As Long
For j = 4 To 21
Sheets("Summary").Select
Fbthoe = Range("A" & j).Value
q = 3
Qtr = Range("d" & q).Value
Sheets("Details").Select
urows = ThisWorkbook.Sheets("Details").UsedRange.Rows.Count
For i = 2 To urows
If Range("C" & i).Value = Fbthoe And Range("F" & i).Value = Qtr Then
Total = Total + Range("G" & i).Value
'MsgBox Total
Else
'do nothing
End If
Next i
Sheets("Summary").Select
Range("D" & j).Value = Total
q = q + 2
Next j
End Sub
This code is only bringing the first matched item for Qtr 1 only to all the cells in column D ie Qtr1 only from the first match ie Conveyance.
The modified file is attached.