Question : excel vba check if a string only contains letters
Answered by : daniel-ferry
'VBA function to test if a string contains only letters:
Function IsAlpha(s) As Boolean IsAlpha = Len(s) And Not s Like "*[!a-zA-Z]*"
End Function
Source : http://academy.excelhero.com/ | Last Update : Sun, 30 Aug 20
Question : VBA check if a cell contains a letter or string
Answered by : nervous-nightingale-1v6revu89zqz
Sub IfContains() If InStr(ActiveCell.Value, "string") > 0 Then MsgBox "The string contains the value." Else MsgBox "The string doesn't contain the value." End If
End Sub
Source : https://excel.officetuts.net/en/vba/check-if-a-cell-contains-a-letter-or-string | Last Update : Fri, 16 Oct 20