Hi,
Well, the IsStartWithCriteria property works for Auto Row Filter feature and not for Custom Row Filter.
Please try the commented lines in previous reply i.e…,:
’grdDataEntry.Worksheets(0).RowFilter.Criteria = “CELL1=”"" + RichTextBox1.Text.Trim + “”""
’grdDataEntry.Worksheets(0).RowFilter.Criteria = “STARTWITH(CELL1, “”” + RichTextBox1.Text.Trim + “”" ,false)"
’grdDataEntry.Worksheets(0).RowFilter.Criteria = “COMPAREIGNORECASE(CELL1, “”” + RichTextBox1.Text.Trim + “”" ,True)"
’grdDataEntry.Worksheets(0).RowFilter.Criteria = “CONTAIN(CELL1, “”” + RichTextBox1.Text.Trim + “”" ,true)"
'Dim part1 As String = “CELL1=”"" + RichTextBox1.Text.Trim + “”""
Dim part1 As String = “CONTAIN(CELL1, “”” + RichTextBox1.Text.Trim + “”" ,true)"
Dim part2 As String = “CELL3=”"" + RichTextBox2.Text.Trim + “”""
'grdDataEntry.Worksheets(0).RowFilter.Criteria = “AND(” + part1 + “,” + part2 + “)”
grdDataEntry.Worksheets(0).RowFilter.Criteria = “OR(” + part1 + “,” + part2 + “)”
…
Notes:
The “=” operator matches exactly. The STARTWITH function matches at the beginning part. The COMPAREIGNORECASE function matches without case. The CONTAIN function matches at any part.
The 3 parameters of these functions indicate whether ignoring case-sensitive. If set to true, it ignores case-sensitivity; else retains/applies.
The AND, OR implement the logical calculations.
Hopefully, you understand now.
Thank you.