To briefly explain why I am not using a combo ListIndex for Excel column identification, the application includes playing music files and generating playlists.
A utility/form to merge one music playlist into another displays playlist names in a MERGE_FROM combo and a MERGE_TO combo. The FROM side does not display playlists that are currently empty. When a merge is executing, the worksheet column for the playlist chosen in the FROM combo has to be identified. There are also two buttons to view detail that make a list box visible to view the music titles associated with the playlist name in the two combos, and your solution is also used in this view function to identify the column where the data resides.
Because the FROM combo may not include every column from a worksheet of playlists due to a playlist being empty, I can't use the combo ListIndex on the FROM side.
I was curious about a shorter VBA method to identify a column than one using a loop, and you provided me the one-line solution.
Code:
playList_Col = Application.WorksheetFunction.Match(cboListValue, _
Sheets("Playlists").Range("1:1"), 0)
Thanks.
Jerry