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
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