ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Testing a string againsts a list of strings (https://www.excelbanter.com/excel-programming/449494-testing-string-againsts-list-strings.html)

JCO

Testing a string againsts a list of strings
 
Does VB for Excel have a method of testing a string to see if it matches a
list of strings similar to "If... Statements"? I would still need to
perform an action if the statement is true (or false depending on the
logic).

If so, I would assume the opposite can be done... see if "String" is one of
the list of strings.

Thanks


Claus Busch

Testing a string againsts a list of strings
 
Hi,

Am Thu, 14 Nov 2013 13:01:25 -0600 schrieb JCO:

Does VB for Excel have a method of testing a string to see if it matches a
list of strings similar to "If... Statements"? I would still need to
perform an action if the statement is true (or false depending on the
logic).


are your strings into the sheet? Then you could use
Worksheetfunction.CountIf


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

JCO

Testing a string againsts a list of strings
 
Yes they are. This will work.
Thanks again.

"Claus Busch" wrote in message
...
Hi,

Am Thu, 14 Nov 2013 13:01:25 -0600 schrieb JCO:

Does VB for Excel have a method of testing a string to see if it matches
a
list of strings similar to "If... Statements"? I would still need to
perform an action if the statement is true (or false depending on the
logic).


are your strings into the sheet? Then you could use
Worksheetfunction.CountIf


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2




All times are GMT +1. The time now is 10:26 AM.

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