Hello All!

I'm having some issues with a project I'm working on. I want to generate a report based on user selected criteria (done in a UserForm) and copy the rows of data that meet the criteria to a different worksheet. Here is my code so far.

Sub Loop_Sort()

Dim y As String
Dim Lastrow As Long

y = Sheets("Archives").Range("Ck1").Value
Lastrow = Cells(Rows.count, 1).End(xlUp).Row

Sheets("Archives").Visible = True
Sheets("Archives").Range("A2").Select

Do
If ActiveCell.Offset(0, 22).Value = Range("CI2").Value = True Then
    If Range("CJ1").Value = "*" And Range("CK1").Value = "*" = True Then
        If ActiveCell.Offset(0, 2).Value = Range("CJ2").Value And ActiveCell.Offset(0, y).Value = Range("CK2").Value = True Then
            ActiveCell.Resize(1, 26).Copy
            Sheets("Report").Range(Lastrow).Select
            ActiveCell.PasteSpecial
        End If
    ElseIf Range("CJ1").Value = "*" And Range("CK1").Value = "" = True Then
        If ActiveCell.Offset(0, 2).Value = Range("CJ2").Value = True Then
            ActiveCell.Resize(1, 26).Copy
            Sheets("Report").Range(Lastrow).Select
            ActiveCell.PasteSpecial
        End If
    ElseIf Range("CJ1").Value = "" And Range("CK1").Value = "*" = True Then
        If ActiveCell.Offset(0, y).Value = Range("CK2").Value = True Then
            ActiveCell.Resize(1, 26).Copy
            Sheets("Report").Range(Lastrow).Select
            ActiveCell.PasteSpecial
        End If
    End If
End If
Loop While ActiveCell.Value <> Empty


End Sub
Essentially, there are 3 potential sets of criteria. The first is the year and will always be included. The second two may not always be there based on the users preference. They are Month and a random assortment of other misc data such as name. The user picks these criteria in a userform and once they click 'create report' the UF dumps these selections into the spreadsheet. Therefore the report can have 4 possible outcomes:

1: A (Just the Year)
2: A & B (Year and a Month)
3: A & C (Year and name)
4: A, B & C (Year, Month and Name)

While in case A the code row must have a matching Year in order to be true, in the others that row must then have a matching B and/or C in order to be true and be copied into the other worksheet. I hope I'm making this all clear.

When I ran the code it just kept going and going, but didn't produce any data. Any Ideas?

Thanks