View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Marcus B Marcus B is offline
external usenet poster
 
Posts: 5
Default Automatically change cell comments

Hi,

I have a range of cells where the user will be able to select an option code
from a data validation list.

I would like to be able to automatically update cell comments to provide a
usefull description depending on which option code has been selected from the
validation list.

I have the following code which works for a single cell and updates the
referenced comment for that cell.

How can I change this so it will work for any cell within a specified range
and update the comment for that cell ?

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("F2")) Is Nothing Then
If Target.Value = "RM4" Then
Comments(1).Text Target & " " & Sheet4.Range("C4")
ElseIf Target.Value = "RM5" Then
Comments(1).Text Target & " " & Sheet4.Range("C6")
ElseIf Target.Value = "" Then
Comments(1).Text "Selection Required"
End If
End If
end sub

thanks,
Marcus