Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If speed is an issue you may want to use a function like this:
Function CountString2(strChar As String, _ strString As String) As Long Dim i As Long Dim n As Long Dim btArray() As Byte Dim btAscChar As Byte If InStr(1, strString, strChar, vbBinaryCompare) = 0 Or _ Len(strString) = 0 Then CountString2 = 0 Exit Function End If btAscChar = Asc(strChar) btArray = strString For i = 0 To UBound(btArray) - 1 Step 2 If btArray(i) = btAscChar Then n = n + 1 End If Next CountString2 = n End Function RBS "SHIRA" wrote in message ... Hi, I have a string that lools like this "F000025" I would like to build a macro that count how many zero i have in my string (4 for this example) or maybe there is a vba function that does that. Anyone? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Count letter string, e.g. h/EL/p | Excel Worksheet Functions | |||
Count Occurances of a txt string | Excel Discussion (Misc queries) | |||
Count string IF..... | Excel Worksheet Functions | |||
How to Count String occurences | Excel Programming | |||
Count Spaces In A String | Excel Programming |