Vlookup based on Cell selection

morleym

New Member
Joined
Jun 3, 2015
Messages
2
Hi all,

Apologies if this has already been covered, but I couldn't find anything with a search...

I have a table, 1 column wide (col A), 20 odd rows deep with various descriptions. I'd like to be able to click/select any one of those cells (A1-A20) and have a more detailed description pop up in a merged cell, C1:D4 - which is based on a lookup of a table that I can create further down the sheet (say A100:B120).

Is this possible?

Many thanks in advance!
Marc
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Just found my answer elsewhere. My thanks to "Luke M" for his post on www.pcreview.co.uk

In your VLOOKUP, replace the cell reference with a name, such as MyRange
Example:
=VLOOKUP(MyRange,A:C,2,FALSE)

Now, right click on the sheet tab, go to view code. Paste this in:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveWorkbook.Names.Add Name:="MyRange", RefersToR1C1:=ActiveCell
End Sub
 
Upvote 0

Forum statistics

Threads
1,207,195
Messages
6,077,010
Members
446,250
Latest member
Dontcomehereoften

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top