hi, thanks for taking time to help me out
scenario
i have a year combobox with values 2007, 2008, 2009, 2010 etc
once i select a year eg 2007 and click search, i want a search to look thru all the worksheets in my workbook.
All my sheets are named(1-jan-2007, 4-feb-2007 etc) so when the user selects 2007, i want only that particular years sheets to be displayed in the listbox... how do i do that? once tat is done, i should be able to click on the worksheets appearing in the listbox and on clickin ok, the particular wksheet pops up...is it possible?
so far i have this:
Private Sub UserForm_Activate()
With YEAR_COMBO 'this adds the following data into the combo box
.AddItem "2007"
.AddItem "2008"
.AddItem "2009"
.AddItem "2010"
End With
End Sub
Private Sub UserForm_Initialize()
Dim ws As Worksheet 'Declaring that ws is term going to be used to refer to worksheets'
For Each ws In ThisWorkbook.Worksheets 'for each wksheet in the current workbk, add the wksheet name to the listbox'
ListBox1.AddItem (ws.Name)
Next ws 'add the next worksheet til last one available is listed'
End Sub
Bookmarks