A VLOOKUP function will only return 1 record from sheet 2.
The best method would be to use a Filter (from Data > Filter in the menu) to return all records with the required code from sheet 1.
To automate this, you could record a macro that filters sheet 2 with the desired code then selects visible cells only (Edit > Goto > Special > Visible Cells Only) then copies the results into sheet 1. In the resulting code, you can then replace the filter value with the value of the code input cell range in sheet 1.