View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
sbowman sbowman is offline
external usenet poster
 
Posts: 17
Default String Comparison using Like Problem

The code below is used in a search to find a row that matches a
person's name entered into a text box on a userform. I can't understand
why my like comparison isn't working:

Dim chkRequestor As String
Dim FindRequestor As String
Dim StrRequestor As String

chkRequestor = Me.txtFindRequestor.Value
StrRequestor = "*" & UCase(chkRequestor) & "*"
Requestor = Range("c" & rowindex).Value
FindRequestor = "*" & UCase(Requestor) & "*"

If StrRequestor Like FindRequestor Then
'Do commands
end if

The strrequestor value I'm using is "*SHELLEY*" and the FindRequestor
value is "*SHELLEY BOWMAN*"...why isn't this working???

Thanks,
Shelley