bradenkeith
New Member
- Joined
- May 4, 2014
- Messages
- 32
Hey guys,
I need some assistance. I'm trying to formulate a string of code for a reverse of VLookup. I am probably way off, but let me try to explain what it is that I'm trying to accomplish:
Let's say Cell A1 is someones place in line, and Cell B1 needs to be entered with the persons corresponding hat color. Let's say the third person in line has a Blue hat. I would use a scroll wheel to change cell A1 to 3, and update Cell B1 with "Blue."
<tbody>
</tbody>
At this point, I would click an "Update" button and a macro would run. The information I entered into cell B1 would be updated into the table I have set up on Spreadsheet3.
<tbody>
</tbody>
Then, I could change Cell A1 to 5 and update Cell B1 to Green, because that is that persons hat color. It would update in the table on Spreadsheet3 and so on..:
<tbody>
</tbody>
This is the non-functioning code i have come up with:
Please help. Thanks.
I need some assistance. I'm trying to formulate a string of code for a reverse of VLookup. I am probably way off, but let me try to explain what it is that I'm trying to accomplish:
Let's say Cell A1 is someones place in line, and Cell B1 needs to be entered with the persons corresponding hat color. Let's say the third person in line has a Blue hat. I would use a scroll wheel to change cell A1 to 3, and update Cell B1 with "Blue."
A | B | |
1 | 3 | Blue |
<tbody>
</tbody>
At this point, I would click an "Update" button and a macro would run. The information I entered into cell B1 would be updated into the table I have set up on Spreadsheet3.
Place in Line | Hat Color |
1 | |
2 | |
3 | Blue |
4 | |
5 |
<tbody>
</tbody>
Then, I could change Cell A1 to 5 and update Cell B1 to Green, because that is that persons hat color. It would update in the table on Spreadsheet3 and so on..:
Place in Line | Hat Color |
1 | |
2 | |
3 | Blue |
4 | |
5 | Green |
<tbody>
</tbody>
This is the non-functioning code i have come up with:
Code:
Sub ReverseVLookup()
i = Sheets("Sheet1").Range("A1").Value
Sheets("Sheet3").Range(i, 2).Value = Sheets("Sheet1").Range("B1").Value
End Sub
Please help. Thanks.