Category Archives for "String Operations"

Count Text in a Range

Counting text in a range is easy. For example, if you would like count how many times “text” is in a specified range (named data), you can write something like this: =COUNTIF(data,”*text*”) This formula will give you the count of all the cells where Excel found “text” at any place. But let’s say you want […]

Continue reading

1 A function to reverse a string

Very simple, uses the VBA function StrReverse to reverse the input string. ‘A function to reverse a string provided as input‘For example, the string “abcd” will become “dcba”‘Uses the VBA function StrReversePublic Function ReverseString(sInputString As String) As StringOn Error GoTo ReverseString_Error    ReverseString = StrReverse(sInputString)    Exit Function ReverseString_Error:    ReverseString = “#ERROR#”End Function

Continue reading
1 2 3
>