I have some code that filters the data in a worksheet, searches the cells in one of the columns for a value and then if a match is found, copies the value of the cell two columns to the left to another sheet. I am searching for the values 1, 2 or 3. Could someone help me in completing this macro to look for each of the three numbers and do the copy if they are found. I have tried a few things but I can't seem to get it it to work properly. This is what the code looks like:
ActiveSheet.Range("$A$1:$G$241").AutoFilter Field:=1, Criteria1:= _
"RELAY Grade 5"
ActiveSheet.Range("$A$1:$G$241").AutoFilter Field:=2, Criteria1:="G"
Dim FirstCell As Integer
Dim LastCell As Integer
FirstCell = Range("G2", Cells(Rows.count, "G").End(xlUp)).SpecialCells(xlCellTypeVisible).Cells(1, 1).Row
LastCell = Range("G2", Cells(Rows.count, "G").End(xlUp)).SpecialCells(xlCellTypeVisible).Cells(5, 1).Row
Dim Cell As Range
For Each Cell In Range("G" & FirstCell & ":G" & LastCell)
If Cell.Value = 1 Then Cell.Offset(0, -2).Select