Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear all:
I have newbie question on how to match strings with excel macro. What I want is to match a word against different elements of an array and do something with it if matches. Lets say I have an array like the one below and now I want to output (msgbox) every time the string "apple" appears. How would I do this? In perl it would be trivial with something like =~ /.apple./ ---------------------------------------------- Dim arr() As Variant ReDim arr(3) arr(1) = "apple tree" arr(2) = "I like apples" arr(3) = "pears are good for you" For x = 1 To 3 If arr(x) = "*apple*" Then msgbox arr(x) end if Next ---------------------------------------------- Unfortunenly the code above does not work. Any help? thanks. alex |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
index and matching with string search! | Excel Worksheet Functions | |||
string matching | Excel Worksheet Functions | |||
Building Sum by Matching String | Excel Discussion (Misc queries) | |||
regex string matching | Excel Programming | |||
Wildcard pattern matching and replace in string | Excel Programming |