Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to count the number of times a sequence of characters occurs in a
cell. The sequence could be surrounded by non-printing characters, and/or could appear more that once in one string (ABCblahABC SDF ABC blah). I tried the following, but it seems to "miss" sometimes. Any reason why? Thanks in advance! Sub getNum() Dim i As Long Dim str As String For i = 2 To Cells(Rows.Count, "a").End(xlUp).Row str = InStr(Cells(i, 1), "ABC") Cells(i, "B") = str Next i End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Count occurences in string | Excel Discussion (Misc queries) | |||
Count occurences of a letter in a cell | Excel Worksheet Functions | |||
Add string occurences | Excel Programming | |||
How to Count String occurences | Excel Programming | |||
count number of occurences within a string | Excel Worksheet Functions |