Hi,
I have a workbook that contains of many worksheets, and I have been looking for an VBA code to get all these worksheets in a drop-down menu to make it easier in navigating between these worksheets and in order to save some time when searching for a specific data that is related to a different worksheets.
Luckily I found this VBA code:
It works good for me, but i just wanna edit it to add a specific worksheets to the list and not all of them.
For example "I want it to add all worksheets that has "PAYROLL" in their names".
Any suggestions ?
Regards,
Mohamed El-Ghareeb
I have a workbook that contains of many worksheets, and I have been looking for an VBA code to get all these worksheets in a drop-down menu to make it easier in navigating between these worksheets and in order to save some time when searching for a specific data that is related to a different worksheets.
Luckily I found this VBA code:
Code:
Private Sub ComboBox1_DropButt*******()
Dim xSheet As Worksheet
On Error Resume Next
Application.ScreenUpdating = False
Application.EnableEvents = False
If ComboBox1.ListCount <> ThisWorkbook.Sheets.Count Then
ComboBox1.Clear
For Each xSheet In ThisWorkbook.Sheets
ComboBox1.AddItem xSheet.Name
Next xSheet
End If
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
For example "I want it to add all worksheets that has "PAYROLL" in their names".
Any suggestions ?
Regards,
Mohamed El-Ghareeb