Here's the data i have
WX20191204-111905.jpg
That is the code i have
intDatRow = 1intDatCol = 1
intRptRow = 6
intRptCol = 2
strAccountCategories = mergeSheet.Cells(1, 2).Value
strQ1 = mergeSheet.Cells(1, 3).Value
dblQ1 = 0
' Process Data
While mergeSheet.Cells(intDatRow, 1).Value > 0
If mergeSheet.Cells(intDatRow, 2).Value = strAccountCategories Then
If mergeSheet.Cells(intDatRow, 3).Value = strQ1 Then
dblQ1 = dblQ1 + mergeSheet.Cells(intDatRow, 5)
Else
rptSheet.Cells(intRptRow, 1).Value = dblQ1
dblQ1 = 0
dblQ1 = dblQ1 + mergeSheet.Cells(intDatRow, 5)
End If
Else
rptSheet.Cells(intRptRow, 1).Value = strAccountCategories
strAccountCategories = mergeSheet.Cells(intDatRow, 2).Value
intRptRow = intRptRow + 1
End If
intDatRow = intDatRow + 1 Wend
And i need to have my report to look like this
Please help with my logic! i'm really struggle
WX20191204-112245.jpg