I have a userform that populates a value in column D. What I'm trying to get it to do when the OK button is clicked is to have a vlookup the value in that column. But it needs to perform a different lookup based on the value.
So if Cell D8 value = 1 then cell F8 lookup formula would be =vlookup(D2,'Pallet and Truss Data'!A9:Z250,5,False)
So if Cell D8 value = 2 then cell F8 lookup formula would be =vlookup(D2,'Pallet and Truss Data'!A9:Z250,9,False)
So if Cell D8 value = 3 then cell F8 lookup formula would be =vlookup(D2,'Pallet and Truss Data'!A9:Z250,13,False)
So if Cell D8 value = 4 then cell F8 lookup formula would be =vlookup(D2,'Pallet and Truss Data'!A9:Z250,17,False)
So if Cell D8 value = 5 then cell F8 lookup formula would be =vlookup(D2,'Pallet and Truss Data'!A9:Z250,21,False)
So if Cell D8 value = 6 then cell F8 lookup formula would be =vlookup(D2,'Pallet and Truss Data'!A9:Z250,25,False)
The Value it needs to lookup is in range D8:D15, D22:D29, D36:D43, D50:D57, D64:D71, D78:D85 and D92:D99
Thanks in advance
Excel 2016
So if Cell D8 value = 1 then cell F8 lookup formula would be =vlookup(D2,'Pallet and Truss Data'!A9:Z250,5,False)
So if Cell D8 value = 2 then cell F8 lookup formula would be =vlookup(D2,'Pallet and Truss Data'!A9:Z250,9,False)
So if Cell D8 value = 3 then cell F8 lookup formula would be =vlookup(D2,'Pallet and Truss Data'!A9:Z250,13,False)
So if Cell D8 value = 4 then cell F8 lookup formula would be =vlookup(D2,'Pallet and Truss Data'!A9:Z250,17,False)
So if Cell D8 value = 5 then cell F8 lookup formula would be =vlookup(D2,'Pallet and Truss Data'!A9:Z250,21,False)
So if Cell D8 value = 6 then cell F8 lookup formula would be =vlookup(D2,'Pallet and Truss Data'!A9:Z250,25,False)
The Value it needs to lookup is in range D8:D15, D22:D29, D36:D43, D50:D57, D64:D71, D78:D85 and D92:D99
Thanks in advance
Excel 2016