View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_2269_] Rick Rothstein \(MVP - VB\)[_2269_] is offline
external usenet poster
 
Posts: 1
Default String Functions

Not sure what you mean by this. Are you asking if the two text strings being
compared are composed of the same characters, just possibly in a different
ordering? If so, there is no operator in VB that does what you want
directly. Give this function a try...

Function IsIdenticalCharacters(Text1 As String, Text2 As String) As Boolean
Dim X As Long
Dim Position As Long
Dim TempText As String
TempText = Text1
For X = 1 To Len(Text2)
Position = InStr(TempText, Mid(Text2, X, 1))
If Position 0 Then Mid(TempText, Position, 1) = Chr$(1)
Next
IsIdenticalCharacters = TempText = String(Len(TempText), Chr$(1))
End Function

Rick


"John" wrote in message
...
Which Operator do i use to compare text. eg if i want to use an "IF"
statement. To test for string that will reflect text written in any order