jeffreybrown
Well-known Member
- Joined
- Jul 28, 2004
- Messages
- 5,152
This formula will count the number of times a is found in A1 whether Upper case or not.
=LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),UPPER("a"),""))
Struggling to figure out how to replace the searched character with
{"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y"}
I've used the below function, but wondering how to use the formula above instead?
=LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),UPPER("a"),""))
Struggling to figure out how to replace the searched character with
{"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y"}
I've used the below function, but wondering how to use the formula above instead?
Code:
Function TextNum(ByVal txt As String, ByVal ref As Boolean) As String
' jindon
' http://www.mrexcel.com/forum/showthread.php?t=362461
' =TextNum(A1,1)
' 1 for Text only
' 0 for Numbers only
With CreateObject("VBScript.RegExp")
.Pattern = IIf(ref = True, "\d+", "\D+")
.Global = True
TextNum = .Replace(txt, "")
End With
End Function
Last edited: