Hi all
I have a large worksheet and one column contains a code consisting of two
letters. The two letters represent the name of a particular division
Division. For example, FG would mean 'Food Group', HR would mean
'Healthcare'.
As there are too many for me to remember what they all mean, is there a way
I can click onto a cell and Excel gives me an 'input message' style box,
telling me what the code stands for?
I have tried to use Data Validation but can't get that to work as it shows
the same input message regardless of what cell I am on.
By the way, the worksheet is sorted in numerical order by another column so
I can't sort it by the Code and then apply separate input messages.
Does anybody have any other ideas???
Thank you.
Louise
Hi
You need to use Data Validation on each cell, separately. If you do this,
you can have different 'input messages' for each one.
Andy.
quot;Louisequot; gt; wrote in message
news
gt; Hi all
gt;
gt; I have a large worksheet and one column contains a code consisting of two
gt; letters. The two letters represent the name of a particular division
gt; Division. For example, FG would mean 'Food Group', HR would mean
gt; 'Healthcare'.
gt;
gt; As there are too many for me to remember what they all mean, is there a
gt; way
gt; I can click onto a cell and Excel gives me an 'input message' style box,
gt; telling me what the code stands for?
gt;
gt; I have tried to use Data Validation but can't get that to work as it shows
gt; the same input message regardless of what cell I am on.
gt;
gt; By the way, the worksheet is sorted in numerical order by another column
gt; so
gt; I can't sort it by the Code and then apply separate input messages.
gt;
gt; Does anybody have any other ideas???
gt;
gt; Thank you.
gt;
gt; Louise
Isn't there a quicker way of doing this rather than each cell individually?
There are hundreds of them.
Thanks.
quot;Andyquot; wrote:
gt; Hi
gt;
gt; You need to use Data Validation on each cell, separately. If you do this,
gt; you can have different 'input messages' for each one.
gt;
gt; Andy.
gt;
gt; quot;Louisequot; gt; wrote in message
gt; news
gt; gt; Hi all
gt; gt;
gt; gt; I have a large worksheet and one column contains a code consisting of two
gt; gt; letters. The two letters represent the name of a particular division
gt; gt; Division. For example, FG would mean 'Food Group', HR would mean
gt; gt; 'Healthcare'.
gt; gt;
gt; gt; As there are too many for me to remember what they all mean, is there a
gt; gt; way
gt; gt; I can click onto a cell and Excel gives me an 'input message' style box,
gt; gt; telling me what the code stands for?
gt; gt;
gt; gt; I have tried to use Data Validation but can't get that to work as it shows
gt; gt; the same input message regardless of what cell I am on.
gt; gt;
gt; gt; By the way, the worksheet is sorted in numerical order by another column
gt; gt; so
gt; gt; I can't sort it by the Code and then apply separate input messages.
gt; gt;
gt; gt; Does anybody have any other ideas???
gt; gt;
gt; gt; Thank you.
gt; gt;
gt; gt; Louise
gt;
gt;
gt;
Louise
There are many other ways of helping you with this. You could keep a list of
the initials - along with their meanings - on a separate sheet. Using a
VLOOKUP formula and an input cell, you could pull back the information you
need. It depends on the layout of your sheets and the data itself, really.
Andy.
quot;Louisequot; gt; wrote in message
...
gt; Isn't there a quicker way of doing this rather than each cell
gt; individually?
gt; There are hundreds of them.
gt;
gt; Thanks.
gt;
gt; quot;Andyquot; wrote:
gt;
gt;gt; Hi
gt;gt;
gt;gt; You need to use Data Validation on each cell, separately. If you do this,
gt;gt; you can have different 'input messages' for each one.
gt;gt;
gt;gt; Andy.
gt;gt;
gt;gt; quot;Louisequot; gt; wrote in message
gt;gt; news
gt;gt; gt; Hi all
gt;gt; gt;
gt;gt; gt; I have a large worksheet and one column contains a code consisting of
gt;gt; gt; two
gt;gt; gt; letters. The two letters represent the name of a particular division
gt;gt; gt; Division. For example, FG would mean 'Food Group', HR would mean
gt;gt; gt; 'Healthcare'.
gt;gt; gt;
gt;gt; gt; As there are too many for me to remember what they all mean, is there a
gt;gt; gt; way
gt;gt; gt; I can click onto a cell and Excel gives me an 'input message' style
gt;gt; gt; box,
gt;gt; gt; telling me what the code stands for?
gt;gt; gt;
gt;gt; gt; I have tried to use Data Validation but can't get that to work as it
gt;gt; gt; shows
gt;gt; gt; the same input message regardless of what cell I am on.
gt;gt; gt;
gt;gt; gt; By the way, the worksheet is sorted in numerical order by another
gt;gt; gt; column
gt;gt; gt; so
gt;gt; gt; I can't sort it by the Code and then apply separate input messages.
gt;gt; gt;
gt;gt; gt; Does anybody have any other ideas???
gt;gt; gt;
gt;gt; gt; Thank you.
gt;gt; gt;
gt;gt; gt; Louise
gt;gt;
gt;gt;
gt;gt;
Louise,
I have prepared a VBA event macro, which can be fired whenever you
select a cell in a specific column.
It presupposes that you have somewhere in your workbook a table with
two columns, one with the 2-letter codes and one with the full names.
To install it you need to copy the following VBA code, after you make
the necessary changes. The right click the sheet tab, choose View
Code... and, once the VBA module comes up, paste the modified code.
It is not perfect, but it might be close to what you need. Whenever the
user clicks on a cell in the specific column, a comment comes up with
the full name. When you click elsewhere the old comment is removed and
the new one appears.
--------cut below---------
Dim oldCell As Range
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim MyColumn As Integer
Dim cell As Range
Dim CodesTable As Range
Set CodesTable = Sheets(quot;Sheet1quot;).Range(quot;A1:C100quot;)
If Not oldCell Is Nothing Then oldCell.ClearComments
Set oldCell = Target.Cells(1, 1)
MyColumn = 3
Set cell = Target.Cells(1, 1)
If cell.Column = MyColumn And Len(cell.Value) lt;gt; 0 Then
cell.ClearComments
cmttext = Application.WorksheetFunction.VLookup(cell.Value,
CodesTable, 2, 0)
cell.AddComment Text:=cmttext
cell.Comment.Visible = False
End If
End Sub
-------------End cut ---------------
What you need to change:
MyColumn = 3 --gt; change it to the number of the column where the
2-letter codes appear.
Set CodesTable = Sheets(quot;Sheet1quot;).Range(quot;A1:B10quot;) --gt; change the
sheetname and the range with your table.
Let us know if it works.
HTH
Kostis Vezerides
- Apr 13 Sun 2008 20:43
Creating input messages or comments
close
全站熱搜
留言列表
發表留言
留言列表

