I've been wanting to show a filtered data on a listbox from the word that I search for from a table. Currently I have the following code:
'First, setting a as the word I want to search through the first column of the table'
Set a = Sheets("Main").Range("P14")
'setting Enertec Fee'
If a = "ENERTEC" Then
frmFeee.lstAHK.RowSource = "AHK_Fee!A6:D9"
frmFeee.lstMD.RowSource = "AHK_MD!A6:D9"
End If
This works but I realised that if I want to add new data on the table, it'll not be updated on the listbox unless I change the code everytime. Is there a better way of going about this? Any help would be greatly appreciated !
I've attached some pictures to help. listbox displaying results
Thank you.