Code giving me a Permission Denied error, multiple lines of the same code and 2 list boxes

Viewed 11

The ListBox2.List = sn is what is being highlighted as the error. I have multiple lines of this code for different textbox's and I have multiple of it on another user form. there is two list boxes on this form not sure what's wrong.

Private Sub Property_Owner_TextBox2_Change()
With Sheets("Found_Property")

lr = .Range("A" & Rows.Count).End(xlUp).Row
ReDim arr(1 To lr - 1)
ReDim sn(1 To lr - 1, 1 To 13)
For i = 1 To UBound(arr)
    arr(i) = .Range("d" & i + 2)
    If InStr(1, arr(i), Property_Owner_TextBox2) > 0 Then
        j = j + 1
        For x = 2 To 8
            sn(j, x - 1) = .Cells(i + 2, x)
        Next
    End If
Next
ListBox2.List = sn

End With
End Sub
0 Answers
Related