I'm trying to filter a sheet by the name "RA" appearing in the second column. I've constructed the following code but it seems there is a compile error: Expected: Expression after I click enter on the line "Field:= ....". Is this the correct syntax for what I am trying to achieve? Thanks.
With CurrentSheet
Set LastAddressCurrent = .Cells(.Rows.Count, "A").End(xlUp)
LastRowCurrent = LastAddressCurrent.Row
.Range(.Cells(1, 2), .Cells(LastAddressCurrent, LastRowCurrent)).AutoFilter
Field:= 2, Criteria1:= "RA"
End If
End With
.Range(.Cells(1, 2), .Cells(LastAddressCurrent, LastRowCurrent)).AutoFilter Field:= 2, Criteria1:= "RA"this should come in a single line. - Mrig....)).AutoFilter _and then in next line writeField:= 2, Criteria1:= "RA"- MrigEnd Ifbut I don't seeIf... - Mrig