Hi,

I have a workbook that is made up of 13 sheets, named January to December and one called reports.

Now i have a sub on the report sheet that runs through all the other sheets and copies certain data to the reports sheet in a nice list.

But i want to add a sort of manual filter to the reports list by way of a combobox.

Options will be:
"All Months" - Copy relevant data from all sheets
"Previous Months" - Copy data from sheets PREVIOUS to system date
"Future Months" - Copy all data from sheets AFTER system date

Im sure you get the idea.

I figured the combobox_change event could fire the current sub, and then i'll have a check in there to see what the combo's value is. Any idea how i can incorporate that so it checks the date and matches it to the sheet names?

Here is the current sub.
VB Code:
  1. Private Sub Worksheet_Activate()
  2. Dim rng As Range
  3. Dim lLastRow As Integer
  4. Dim iNextRow As Integer
  5. Dim x As Integer
  6. Dim bFound As Boolean
  7.  
  8. Dim ws As Worksheet
  9. Dim sht_Rpt As Worksheet  'Set a handle for the Reports Sheet
  10. Set sht_Rpt = Sheets("Reports")
  11.  
  12.     sht_Rpt.Rows("7:65536").Delete Shift:=xlUp
  13.     bFound = False
  14.     For Each ws In Worksheets
  15.         If ws.Name <> "Reports" Then
  16.             Set rng = ws.Range("A1").SpecialCells(xlCellTypeLastCell)
  17.             lLastRow = rng.Row
  18.            
  19.             For x = 2 To lLastRow 'First two rows contain headers etc
  20.                 If ws.Cells(x, "E").Value = "" And ws.Cells(x, "A").Value <> "" And ws.Cells(x, "E").Interior.ColorIndex = xlNone Then
  21.                     If bFound = False Then
  22.                         bFound = True
  23.                         With sht_Rpt.Cells(FindBottomRow(sht_Rpt, 1), "A")
  24.                             .Font.Bold = True
  25.                             .Value = ws.Name
  26.                         End With
  27.                     End If
  28.                     iNextRow = FindBottomRow(sht_Rpt, 1)
  29.                     sht_Rpt.Range("A" & iNextRow, "D" & iNextRow).Value = ws.Range("A" & x, "D" & x).Value
  30.                     sht_Rpt.Range("E" & iNextRow).Value = ws.Range("G" & x).Value
  31.                 End If
  32.             Next x
  33.         End If
  34.         bFound = False
  35.     Next
  36. End Sub