To mimic your code sample, something like this :
Dim rngSource As Range
Dim avarAccounts() As Variant
Dim varSum As Variant
Dim strValue As String
Dim rngCell As Range
Dim varInc As Variant
' Initialization
Set rngSource = ThisWorkbook.Sheets(1).Range("A2:A13")
avarAccounts = Array("50", "511", "512")
' Sum
varSum = 0
For Each rngCell In rngSource
strValue = rngCell.Value2
For Each varInc In avarAccounts
If Left$(strValue, Len(varInc)) = varInc Then
varSum = varSum + rngCell.Offset(0, 4).Value
Exit For
End If
Next varInc
Next rngCell
' Save Result
' ...
A better alternative would be to let Excel do the calculation for you
Dim strAccounts As String
Dim strAmounts As String
Dim avarAccounts() As Variant
Dim varSum As Variant
Dim varInc As Variant
' Initialization
strAccounts = "sheet1!$A$2:$A$13"
strAmounts = "sheet1!$E$2:$E$13"
avarAccounts = Array("50", "511", "512")
' Compute Sum
varSum = 0
For Each varInc In avarAccounts
varSum = varSum + Application.Evaluate("=SUM((LEFT(" & strAccounts & ","
& Len(varInc) & ")=" & """" & varInc & """)*(" & strAmounts & "))")
Next varInc
' Save Result
' ...