This can be done with 1, perhaps 2 lines:
Sub Macro2()
Sheets("Sheet3").Cells.Clear
Sheets("Sheet2").Columns("A:B").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Sheets("Sheet1").Range("A1:A2"), CopyToRange:=Sheets("Sheet3").Range("A1"), Unique:=False
End Sub
but...
Sheet2 needs to have unique headers in row 1 in as many columns as you want to copy across.
Sheet1 needs the single header in A1 exactly the same as column A header in sheet2, as well as the value sought in A2
The code line starting:
Sheets("Sheet2").Columns("A:B").AdvancedFilter…
needs adjusting to cover the columns you want to copy over, so if 5 columns, you need to change it to:
Sheets("Sheet2").Columns("A:E").AdvancedFilter…
and again, all columns must have a header.