ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How can I look for a sub-string within a string in VBA and... (https://www.excelbanter.com/excel-programming/364914-how-can-i-look-sub-string-within-string-vba.html)

k. moran

How can I look for a sub-string within a string in VBA and...
 
Hi Again,

I need to figure out how I can find a substring within a string in VBA.
Say Col A, Row1 = cats, dogs, pigs

and I want to find cats and if possible know the position in the string.
If it occurs first then I need to count it otherwise I don't

I found find in the worksheet function, but I can't find it in VBA.
Also what is a good book that has all the VBA functions?

Thanks As Always! Kurt

Gary''s Student

How can I look for a sub-string within a string in VBA and...
 
checkout InStr() in VBA Help.
--
Gary's Student


"k. moran" wrote:

Hi Again,

I need to figure out how I can find a substring within a string in VBA.
Say Col A, Row1 = cats, dogs, pigs

and I want to find cats and if possible know the position in the string.
If it occurs first then I need to count it otherwise I don't

I found find in the worksheet function, but I can't find it in VBA.
Also what is a good book that has all the VBA functions?

Thanks As Always! Kurt



All times are GMT +1. The time now is 09:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com