Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
OK, this one is really getting to me. Without using Excel specific
functions, how can I test if I've found the exact match of a word or phrase? I've came up with the code below, which works great in most cases (Test1 and Test2). My problem is I could be testing html source code (Test3). My head hurts, so I post here in hopes of some help. Thanks! Sub tester() Dim vSplit As Variant Dim bExactMatch As Boolean Dim sTest1 As Variant Dim sTest2 As Variant Dim sTest3 As Variant sTest1 = "this is a test, here's the stuff you wanted. " vSplit = Split(sTest1, " here's ") bExactMatch = UBound(vSplit) < 0 Debug.Print "Test1: " & bExactMatch sTest2 = "this is a test, there's the stuff you wanted. " vSplit = Split(sTest2, " here's ") bExactMatch = UBound(vSplit) < 0 Debug.Print "Test2: " & bExactMatch sTest3 = "<bhere's</b the stuff you wanted. " vSplit = Split(sTest3, " here's ") bExactMatch = UBound(vSplit) < 0 Debug.Print "Test3: " & bExactMatch End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find Exact Match using INDEX, MATCH | Excel Worksheet Functions | |||
vlookup and finding text string that's not an exact match | Excel Discussion (Misc queries) | |||
TEST FOR EXACT TEXT | Excel Worksheet Functions | |||
Calculating p-value from Fisher's Exact Test for XYZ parameters | Excel Worksheet Functions | |||
Calculating p-value from Fisher's Exact Test | Excel Worksheet Functions |