Patriot2879
Well-known Member
- Joined
- Feb 1, 2018
- Messages
- 1,259
- Office Version
- 2010
- Platform
- Windows
Hi good morning, Please can you help me, i get a 'Run time error 380 property invalid property value' and it highlights in yellow the line below, but i have no idea how to correct it as i cant see what the issue is
anf this is the whole code for my listbox -
Really hope you can help me please.
VBA Code:
.RowSource = "Data_Display!A2:K" & lr
Code:
Sub Refresh_Listbox()
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Data")
Dim dsh As Worksheet
Set dsh = ThisWorkbook.Sheets("Data_Display")
''''''''''' Copy Data ''''''''''
dsh.Cells.Clear
sh.AutoFilterMode = False
If Me.cmb_Filter_By.Value <> "ALL" Then
sh.UsedRange.AutoFilter Application.WorksheetFunction.Match(Me.cmb_Filter_By.Value, sh.Range("1:1"), 0), "*" & Me.txt_Search.Value & "*"
End If
sh.UsedRange.Copy dsh.Range("A1")
sh.AutoFilterMode = False
Dim lr As Long
lr = Application.WorksheetFunction.CountA(dsh.Range("A:A"))
If lr = 1 Then lr = 2
With Me.ListBox1
.ColumnHeads = True
.ColumnCount = 11
.ColumnWidths = "20,160"
.RowSource = "Data_Display!A2:K" & lr
End With
End Sub
Really hope you can help me please.