Copy and paste on certain cells based on index

Hello,
Here's the setup:

Sheet Two contains two rows of data.
Row 1 contains the index of the value in row 2, ex:
1           2        3         4     etc....
0.23    0.34   0.61    0.12

Sheet One has a row of indices, ex:
2     4     9    etc...

I need a script/formula to copy the values for the indices in Sheet Two to the appropriate indices in Sheet One, ex:
Sheet One after script:
2           4      etc....
0.34    0.12

Need more info?

Thanks!
Christa
christamccAsked:
Who is Participating?
 
NorieVBA ExpertCommented:
If you want a formula you could try INDEX:

=INDEX(Sheet2!$2:$2,, A1)
0
 
Patrick MatthewsCommented:
Try hlookup:

=hlookup(a1,'sheet two'!$1:$2,2,false)
0
 
christamccAuthor Commented:
I forgot to mention that the index is not the header row and I could have multiple rows of indexes on a sheet, so HLOOKUP wouldn't work for my situation, but I was able to get INDEX to work.

Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.