If you look inside the 'Search' button code on the userform you will find a line of code:
Me.ListBox1.List = PDFvarName
You can swap that for the below:
If Len(Join(PDFvarName)) > 0 Then
Me.ListBox1.List = PDFvarName
ListBox1.Enabled = True
ListBox1.ForeColor = vbBlack
Else
Me.ListBox1.List = Array("Not Found")
ListBox1.Enabled = False
ListBox1.ForeColor = RGB(128, 128, 128)
End If
You will also find line:
Me.ListBox2.List = DXFvarName
You can swap that for the below:
If Len(Join(DXFvarName)) > 0 Then
Me.ListBox2.List = DXFvarName
ListBox2.Enabled = True
ListBox2.ForeColor = vbBlack
Else
Me.ListBox2.List = Array("Not Found")
ListBox2.Enabled = False
ListBox2.ForeColor = RGB(128, 128, 128)
End If
Hope this helps