This was motivated by "attitude" equalling 100, while "hard work" only equals 98.
Have fun.
Sub mySub()
myString = UCase(Range("B6").Text)
myAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
myValue = 0
For i = 0 To Len(myString) - 1myStringChar = Mid(myString, i + 1, 1)Next i
For j = 1 To 26myChar = Mid(myAlphabet, j, 1)Next j
myVal = Replace(myStringChar, myChar, j)
If IsNumeric(myVal) ThenmyValue = myValue + CInt(myVal)End If
Exit For
Range("B7").Value = myValue
End Sub
No comments:
Post a Comment