Thread: sum
View Single Post
 
Old 11-23-2019, 10:49 AM
shovan shovan is offline Windows 7 32bit Office 2010
Novice
 
Join Date: Nov 2019
Posts: 1
shovan is on a distinguished road
Default sum

I have some fixed data in Sus_AC and the same continuous data in FR_Data. If two data match then sum another data how. Please help. My trying is given bellow. I am new in vba. Please help me.

Dim i As Long, a As Double
a = 0
For i = 3 To lastRow
If Worksheets("Sus_AC").Cells(i, 3).Value = Worksheets("FR_Data").Cells(i, 4).Value Then
a = a + Worksheets("FR_Data").Cells(i, 23).Value
Worksheets("Sus_AC").Select
Worksheets("Sus_AC").Cells(i, 7).Value = a
End If
Next i
Reply With Quote