Here is a simple routine that can be modified to do what
you want. You will need to set up a lookup table for the
VLOOKUP function somewhere in your workbook (I am using
the named range "LookupRange" in the example) - the lookup
range should be a sorted 2-column list with your codes in
the first column and the corresponding descriptions in the
2nd column.
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As
Object, ByVal Target As Range, Cancel As Boolean)
Dim ShowMe As Variant
ShowMe = WorksheetFunction.VLookup(Target.Value, Sheets
("Sheet1").Range("LookupRange"), 2, False)
MsgBox Target.Value & ": " & ShowMe
End Sub
-----Original Message-----
Hello there,
I am currently in the process of setting up a stock
contol spreadsheet.
Each item of stock is issued with a particular code. Is
there anyway
that I can programme Excel to store information on a
particular code.
That is, if I were to type the code AFS341 in a cell, I
would like the
stock description to be some how nested in the cell so
that if a user
wanted to find out the stock description, they could do
someting like
double click on the code to reveal the nested
description. I hope this
makes sense to you.
Many thanks
---
Message posted from http://www.ExcelForum.com/
.