Thread: InStr question
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default InStr question

The InStr function cannot return the numbers you seem to be indicating it
does (InStr returns a position number, not a count), which probably means
you have code that you have not shown us. It is kind of hard to give you
advice if we don't know what you are attempting to do. Post the code you
have (working or not) so we can get an idea of what you are trying to do. If
you can supplement that with a description of what you want your code to be
doing, that would be good as well.

--
Rick (MVP - Excel)


"CG Rosen" wrote in message
...
Good day group,

Trying to use the InStr function in VBA to find if various numbers is
contained in a string.

If InStr(c.value, "String") 0
Then..........................................etc

The c.value can be from 1 to 50. The string can look like "1,15,21" . If
the c.value =1 that number
is then found 3 times. How is it possible to do a distinction that 1 is
only found one time and 2 one time and say 21 one time and so on? Do I
need some other kind of separator in the string?

Hope my question is understandable.

Brgds

cgr