Add worksheet name (Tab) to list for search

DThib

Active Member
Joined
Mar 19, 2010
Messages
464
Office Version
  1. 365
Platform
  1. Windows
I can't seem to find this particular problem here.

I need to add the tabs in a workbook to a userform ListBox to use as the first result in a search string.

What will happen, hopefully, is the user will activate the userform and have a listbox with all tabs (worksheets) showing, When selected the next Box (text or combo) will give the user a chance to reduce the number of components in that worksheet.

My problem is finding the right code to query for tabs(worksheets) in the workbook to be in that list and the selection from the list to prompt for selecting it.

Any ideas?
:confused:

Excel 2003, Wondows XP Professional
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Try this in the userform's code module

Code:
Private Sub UserForm_Initialize()
Dim i As Long
With ListBox1
    For i = 1 To Worksheets.Count
        .AddItem Worksheets(i).Name
    Next i
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,723
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top