Q:

Adding a group of numeric value in a column based on another criteria from another column

I have table in Sheet1.  I can sum up all numeric data of a certain Country.
However I wanted only to sum-up to numbers with the same date.
I have ComboBox for the date.  So for example If I choose July 1, it will only add those numbers in July 1.
My desired result if I choose July 1 is the following:
America     24
Brazil      56
Canada      68
screenshot

My code:
Private Sub ComboBox1_Change()

Dim a As Long
Dim b As Long
Dim c As Long
Dim lastrow As Long

a = 0
b = 0
c = 0

lastrow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Row

For i = 2 To lastrow
If Cells(i, 3) = "America" Then
a = Cells(i, 4) + a

ElseIf Cells(i, 3) = "Brazil" Then
b = Cells(i, 4) + b

ElseIf Cells(i, 3) = "Canada" Then
c = Cells(i, 4) + c
End If
Next i

'Range("A16") = a

txtAmerica.Value = a
txtBrazil.Value = b
txtCanada.Value = c

End Sub

Private Sub UserForm_Initialize()

ComboBox1.List = Sheets("Sheet1").Range("G1:G10").Value

End Sub

A:

Assuming the values in column A are dates, and also assuming your locale is using a mm/dd/yyyy date format, this is as simple as just wrapping your summation code in an If statement that checks the date:
For i = 2 To lastrow
    If Cells(i, "A").Value = CDate(ComboBox1.Value) Then
        If Cells(i, 3) = "America" Then
            a = Cells(i, 4) + a
        ElseIf Cells(i, 3) = "Brazil" Then
            b = Cells(i, 4) + b
        ElseIf Cells(i, 3) = "Canada" Then
            c = Cells(i, 4) + c
        End If
    End If
Next i

