I have the below which is meant to look for the first instance of "Test" in column B and once found copies the cells directly to the left of it and pastes it onto Sheet3 Cell AJ3 if the value of the cell 2 cells to the right of where 'Test' is found matches cell C1 but it should paste it to SHeet3 AK3 if the cell 2 cells to the right of where 'Test' is found matches cell D1. The code runs but does nothing. I'm really close I think so it must just need some minor tweaks?

Sub FirstTryTime()

Dim rng As Range
Dim ws1 As Worksheet: Set ws1 = Worksheets("Sheet2")
Dim ws2 As Worksheet: Set ws2 = Worksheets("Sheet3")

Sheets("Sheet2").Select

For Each rng In Range("B2:B" & Range("B" & Rows.Count).End(3).Row)
    If rng = "Test" Then
                    
          
                    If rng(0, 2).Value = ws1.Range("C1").Value Then
                        rng.Offset(0, -1).Copy ws2.Cells(3, "AJ").Paste
                    End If
           
                    If rng(0, 2).Value = ws1.Range("D1").Value Then
                       rng.Offset(0, -1).Copy ws2.Cells(3, "AK").Paste
                    End If
                        
             Exit For
            End If
Next rng

End Sub