Filter list of all sheets in a project to contain only specified sheets

I am trying to place legends on sheets however not all sheets will get a legend. How can I filter the list on the right (which is all sheets in the model) to contain only the sheets that match the sheet numbers from the list on the left (sheet numbers that need the legends) Any help is greatly appreciated. Thanks.

You would need to use your lower list of sheets and find the indices of those sheets in the upper list. Then use those indices to filter your transposed list.

Thank you for the response.