لدى مشكلة في خطا مرفق لكم الخطأ
اتمني من الله ثم من اساتذتنا المساعدة
Private Sub ButtonSerach_Click()
Dim tb1 As Boolean, ib As Boolean
Dim R As Long, RR As Long
Dim C As Integer
Dim MyFind, MySrch, MyVelue
''''''''''''''''''''''
Me.ListFind.Clear
If Len(Trim(Me.TextFind)) = 0 Then Exit Sub
'''''''''''''''''''''
C = Me.BoxFind.ListIndex + 1
tb1 = CBool(Me.CheckFindDate.Value = True)
If tb1 Then
If Not IsDate(Me.TextFind) Then kh_SetDate Me.TextFind
MyFind = CDbl(CDate(Me.TextFind))
Else
MyFind = Me.TextFind.Value
End If
'''''''''''''''''''''''
With MyRngdate.Cells(2, Ar(C))
For R = 1 To ContRow
If Len(Trim(.Cells(R, 1))) Then
If tb1 Then MySrch = .Cells(R, 1).Value2 Else MySrch = .Cells(R, 1).Value
ib = IIf(Me.CheckFind.Value, InStr(1, MySrch, MyFind, vbTextCompare) = 1, InStr(1, MySrch, MyFind, vbTextCompare))
If ib Then
MyVelue = .Cells(R, 1).Value
If IsDate(MyVelue) Then MyVelue = Format(MyVelue, DtF)
Me.ListFind.AddItem MyVelue
Me.ListFind.List(RR, 1) = R
RR = RR + 1
End If
End If
Next
End With
Me.LblFindCount = Me.ListFind.ListCount
If RR = 0 Then MsgBox " لا توجد نتائج لبحثك هذا ", mBox, "تنبيه"
'''''''''''''''''''''''''
End Sub