ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   getting comment pop-up (https://www.excelbanter.com/excel-worksheet-functions/181068-getting-comment-pop-up.html)

A M I T

getting comment pop-up
 
I use MS Excel 2007.
I have data validation list for a range of cells. There are 4 values to
choose from.

My requirement: There are 2 values which, when, selected should prompt the
use to enter a text/comment that is saved. This comment/text can bee seen by
moving the mouse over the cell.
However, if the value is changed to either of the other 2 - the comment/text
is automatically deleted.

Gary''s Student

getting comment pop-up
 
Here is an example:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set b9 = Range("B9")
If Intersect(t, b9) Is Nothing Then Exit Sub
Application.EnableEvents = False
With t
If .Value = "first" Or .Value = "second" Then
.ClearComments
Else
MsgBox ("Please enter a comment.")
End If
End With
Application.EnableEvents = True
End Sub
--
Gary''s Student - gsnu200775


"A M I T" wrote:

I use MS Excel 2007.
I have data validation list for a range of cells. There are 4 values to
choose from.

My requirement: There are 2 values which, when, selected should prompt the
use to enter a text/comment that is saved. This comment/text can bee seen by
moving the mouse over the cell.
However, if the value is changed to either of the other 2 - the comment/text
is automatically deleted.


A M I T[_2_]

getting comment pop-up
 
Thanks for the help.
However, it did not execute with the range specified.
The cell range in use is K7:AR73 and the values for which the popup are
reqd. are "hc" , "sc", "w".


"Gary''s Student" wrote:

Here is an example:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set b9 = Range("B9")
If Intersect(t, b9) Is Nothing Then Exit Sub
Application.EnableEvents = False
With t
If .Value = "first" Or .Value = "second" Then
.ClearComments
Else
MsgBox ("Please enter a comment.")
End If
End With
Application.EnableEvents = True
End Sub
--
Gary''s Student - gsnu200775


"A M I T" wrote:

I use MS Excel 2007.
I have data validation list for a range of cells. There are 4 values to
choose from.

My requirement: There are 2 values which, when, selected should prompt the
use to enter a text/comment that is saved. This comment/text can bee seen by
moving the mouse over the cell.
However, if the value is changed to either of the other 2 - the comment/text
is automatically deleted.



All times are GMT +1. The time now is 06:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com