Sum values associated with most frequently occurring text

Macro Title:
Worksheet Variable:
Worksheet Name:
Range Reference:
Sum Range:
Output Cell:
First Comment:

'
Second Comment:

'

Sub Sum_values_associated_with_most_frequently_occurring_text()
'declare a variable

Dim ws As Worksheet

Set ws = Worksheets("Analysis")
'apply the formula to sum values that are associated with most frequently occurring text

ws.Range("F4").Formula = "=SUMIF(B5:B11,INDEX(B5:B11,MODE(MATCH(B5:B11,B5:B11,0))),C5:C11)"

End Sub