Let's say I have this variable:
word = "habit"
which command in VBA will allow me to count how many characters are there in this variable (in my case it's 5).
Important: the variable "word" contains only one word, no spaces, but may have contain numbers and hyphens.
Use the Len function
length = Len(myString)
Len is what you want.
word = "habit"
length = Len(word)
Len(word)
Although that's not what your question title asks =)
Try this:
word = "habit"
findchar = 'b"
replacechar = ""
charactercount = len(word) - len(replace(word,findchar,replacechar))
Source: Stackoverflow.com