Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Stoke
 
Posts: n/a
Default Can I display comments in a validation list

I am new to using these Validation lists - I have comments associated with
the validation list, and I am wondering if there is a way to bring the
comment into the target cell with the contents of the Validation list cell
when it is selected from the drop-down box. Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default Can I display comments in a validation list

Maybe...

You might be able to use a macro...

I created a list on Sheet1. I named it myList (to be used with
data|validation).

Then on sheet2, I used data|validation in A1 and pointed to that list on sheet1.

Place the code in the sheet2 worksheet module.

rightclick on the worksheet tab with the data validation. Select view code.
Paste this in the new code window:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim res As Variant
Dim myList As Range

If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("a1")) Is Nothing Then Exit Sub
If Target.Value = "" Then Exit Sub

'clear previous comment
If Target.Comment Is Nothing Then
'do nothing
Else
Target.Comment.Delete
End If

Set myList = Worksheets("sheet1").Range("mylist")

res = Application.Match(Target.Value, myList, 0)

If IsError(res) Then
'something very bad happened
Else
If myList(res).Comment Is Nothing Then
'do nothing
Else
Target.AddComment Text:=myList(res).Comment.Text
End If
End If

End Sub

Then back to excel and test it out.

(This won't work with xl97.)

Stoke wrote:

I am new to using these Validation lists - I have comments associated with
the validation list, and I am wondering if there is a way to bring the
comment into the target cell with the contents of the Validation list cell
when it is selected from the drop-down box. Thanks


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing data validation scenarios SJC Excel Worksheet Functions 14 July 24th 05 12:43 AM
How to create a Sub validation list in excel? Simon Excel Discussion (Misc queries) 1 July 13th 05 10:31 AM
I cannot get time format to display in a drop-down list Mighty Mike Excel Discussion (Misc queries) 0 February 1st 05 09:47 PM
list validation using list validation... Patrick G Excel Worksheet Functions 1 December 21st 04 12:37 AM
Validation - List - Separate Worksheet J. Osborne Excel Worksheet Functions 1 October 28th 04 04:23 PM


All times are GMT +1. The time now is 03:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"