|re: "I got the correct responses, but I don't think the coding is correct."|
If you got the correct responses, why don't you think the coding is correct?
If you are trying to lock down the lookup_array so that it doesn't change when you drag, drop or paste the formula, use:
=VLOOKUP(B6, works!$A$1:$D$4, 2, False),
This formula will always lookup your lookup_value in $A$1:$A$4 and return the corresponding value from $B$1:$B$4 since your col_index_num is 2.
If you want to pull values from Column C, the col_index_num should be 3.
Keep in mind that the col_index_num is not the number of the spreadsheet column, but the index number of the column in the lookup_array
In other words, if you used:
=VLOOKUP(B6, works!$F$1:$H$4, 2, False), 2 would refer to Column G
=VLOOKUP(B6, works!$F$1:$H$4, 3, False), 3 would refer to Column H
Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.