View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Graham[_2_] Graham[_2_] is offline
external usenet poster
 
Posts: 32
Default Find exact text match

Thanks to all for the replies, I have now managed to get the procedure to work fine thanks
to your efforts. I am very grateful for all your help.

Graham

Graham wrote:
I am having a problem with the part of a procedure below in that I want
it to find an exact match and it does not do that. For example
Cells(n,14) at any point may have SB and the loop is picking up NF-TSB
in Rng. I would value any guidance.

Set Rng = Range("AA1:AA30")
With Rng
For N = 15 To 42
Set C = .Find(Cells(N, 14).Value, LookIn:=xlValues)
If Not C Is Nothing Then
firstAddress = c.Address
Do
----STATEMENTS
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
Next
End With

Kind Regards,
Graham