Q:

Excel VBA Function - Check if string has more numbers than letters

I am using this function to test if a string has numbers. However, I need to somehow modify this to check if the string has actually more numbers than letters.  
Function HasNumber(strData As String) As Boolean
    Dim iCnt As Integer

    For iCnt = 1 To Len(strData)
        If IsNumeric(Mid(strData, iCnt, 1)) Then
            HasNumber = True
            Exit Function
        End If
    Next iCnt

End Function

A:

I think one of these functions should hopefully do what you need. The only difference between them is what they consider as "letters".
Option Explicit

Private Function MoreNumbersThanLetters(ByVal someTextToCheck As String) As Boolean
    ' "Letters" in the context of this function = "a-z,A-Z"
    ' as opposed to "anything that's not a number".
    ' This means this function ignores symbols (non-numeric, non-alphabetical characters)

    Dim countOfLetters As Long
    Dim countOfNumbers As Long

    Dim characterIndex As Long
    For characterIndex = 1 To Len(someTextToCheck)
        Select Case Asc(Mid$(someTextToCheck, characterIndex, 1))
            Case 65 To 90, 97 To 122 ' A-Z, a-z
                countOfLetters = countOfLetters + 1
            Case 48 To 57 ' 0-9
                countOfNumbers = countOfNumbers + 1
        End Select
    Next characterIndex

    MoreNumbersThanLetters = countOfNumbers > countOfLetters
End Function

Private Function MoreNumbersThanLetters(ByVal someTextToCheck As String) As Boolean
    ' "Letters" in the context of this function = "anything not a number",
    ' so this function consider symbols as letters too.

    Dim countOfNumbers As Long

    Dim characterIndex As Long
    For characterIndex = 1 To Len(someTextToCheck)
        If IsNumeric(Mid$(someTextoCheck, characterIndex, 1)) Then
            countOfNumbers = countOfNumbers + 1
        End If
    Next characterIndex

    MoreNumbersThanLetters = (countOfNumbers / Len(someTextToCheck)) > 0.5

End Function

