الكود لا يعمل عند فتح ملف اخر مع الملف الخاص ب اليور فورم
Private Sub TextBox1_Change()
If Me.TextBox1 = "" Then
Me.TextBox1.BackColor = vbRed
Else
Me.TextBox1.BackColor = vbWhite
End If
Dim i As Long, ii As Long, j As Integer
Dim Ary()
Me.Frame1.Visible = False
ListBox1.Clear
iNdx = ""
With Worksheets("Active Sheet")
For i = 2 To .Cells(Rows.Count, "A").End(xlUp).Row
If InStr(.Cells(i, "A"), CStr(Me.TextBox1)) = 1 Then
iNdx = iNdx & " " & i
ii = ii + 1
ReDim Preserve Ary(1 To ContColmn, 1 To ii)
For j = 1 To ContColmn
Ary(j, ii) = .Cells(i, j).Value
Next
End If
Next
End With
If ii Then Me.ListBox1.Column = Ary
Erase Ary
End Sub
Private Sub TextBox10_Change()
End Sub
Private Sub TextBox2_Change()
End Sub
Private Sub TextBox4_Change()
End Sub