Sub ChooseSheetNumberToUse() ' select a sheet to copy
'
Dim UserSelectedSheet As String
'
Worksheets(1).Activate ' Had to add this to allow the sheet selected to work
'
MsgBox "In the next popup window, Click the sheet name " & vbCrLf & "that you would like to copy." ' Advise user what to do next
'
If Application.CommandBars("workbook tabs").Controls(16).Caption Like "More Sheets*" Then ' This CommandBars only shows up to 16 sheets, after that it
' will display the first 15 sheets and the 16th item will be
' an option of "More Sheets..." which will give full list
Application.CommandBars("workbook tabs").Controls(16).Execute ' If more than 16 sheets are found, click the "More Sheets ..."
Else ' Otherwise ...
Application.CommandBars("Workbook Tabs").ShowPopup 800, 300 ' Display the sheets found
End If
'
UserSelectedSheet = ActiveSheet.Name ' Save the sheet name that the user selected
Debug.Print UserSelectedSheet ' Test print, for verification, name of user selected sheet
'
' The variable 'UserSelectedSheet' now contains the sheet name selected by the user
'
'
' Add desired additional coding here ...
'
End Sub