Please clarify me what is the meaning of "><=" in function Instr?

hunghung

New Member
Joined
Feb 27, 2018
Messages
19
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I am learning about UDF. So I saw a code as below and I didn't understand operators "><=" in that code
Code:
Chk = (InStr("><=", Left(FindStr, 1)) > 0)

Can I help me to clarify it?
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
It's just testing to see if the first character of FindStr is < or > or =
 
Upvote 0
But i think it's has different meaning.
This is a full code that help filter 2 dimension array.
Code:
Function Filter2DArray(ByVal sArray, ByVal ColIndex As Long, ByVal FindStr As String, ByVal HasTitle As Boolean)
    Dim TmpArr, I As Long, J As Long, Arr, Dic, TmpStr, Tmp, Chk As Boolean, TmpVal As Double
    On Error Resume Next
    Set Dic = CreateObject("Scripting.Dictionary")
        TmpArr = sArray
        ColIndex = ColIndex + LBound(TmpArr, 2) - 1
        Chk = (InStr("><=", Left(FindStr, 1)) > 0)
    For I = LBound(TmpArr, 1) - HasTitle To UBound(TmpArr, 1)
        If Chk And FindStr <> "" Then
            TmpVal = CDbl(TmpArr(I, ColIndex))
            If Evaluate(TmpVal & FindStr) Then Dic.Add I, ""
        Else
            If Left(FindStr, 1) = "!" Then
                If Not (UCase(TmpArr(I, ColIndex)) Like UCase(Mid(FindStr, 2, Len(FindStr)))) Then Dic.Add I, ""
            Else
                If UCase(TmpArr(I, ColIndex)) Like UCase(FindStr) Then Dic.Add I, ""
            End If
        End If
    Next
    If Dic.Count > 0 Then
        Tmp = Dic.Keys
        ReDim Arr(LBound(TmpArr, 1) To UBound(Tmp) + LBound(TmpArr, 1) - HasTitle, LBound(TmpArr, 2) To UBound(TmpArr, 2))
            For I = LBound(TmpArr, 1) - HasTitle To UBound(Tmp) + LBound(TmpArr, 1) - HasTitle
                For J = LBound(TmpArr, 2) To UBound(TmpArr, 2)
                    Arr(I, J) = TmpArr(Tmp(I - LBound(TmpArr, 1) + HasTitle), J)
                Next
            Next
        If HasTitle Then
            For J = LBound(TmpArr, 2) To UBound(TmpArr, 2)
                Arr(LBound(TmpArr, 1), J) = TmpArr(LBound(TmpArr, 1), J)
            Next
        End If
    End If
    Filter2DArray = Arr
End Function

I see "!" appear in code. Is it actually means as normal characters?
 
Upvote 0
Yes, they are just normal characters. It means exactly what I said. :)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top