Would this piece of code for the search box take you in the direction you want?
Needs some additions.
Private Sub search_for_someone_Change()
Dim ctr As Object, btn As MSForms.CommandButton, part
'here is the problem
For Each ctr In Me.Controls 'Loop to all the controls in the form
If TypeOf ctr Is CommandButton Then 'Check if it's a button
Set btn = ctr
Select Case ctr.Name
Case "buton_office_model", "buton_executie_model"
'Skip
Case Else
' Debug.Print ctr.Name & ": " & btn.Caption & " on " & ctr.Parent.Name
part = Split(btn.Caption, ":") 'Split the name and the function
If InStr(1, part(0), Me.search_for_someone) > 0 Or _
InStr(part(1), Me.search_for_someone) > 0 Then 'Check if the button matches the search criteria
ctr.Visible = True 'If match show the button
Else
ctr.Visible = False 'If no match hide the button
End If
End Select
End If
Next ctr
Set btn = Nothing
End Sub
Bookmarks