ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   mouse pointer over cell (https://www.excelbanter.com/excel-discussion-misc-queries/191369-mouse-pointer-over-cell.html)

Atishoo

mouse pointer over cell
 
Can I make the contents of a variable cell (an offset cell depending on the
current date) appear when the mouse pointer hovers over a cell.
Have tried using a comment box but this seems only to display the data
directly entered and will not accept a function such as "=offset (c,0)" I
knew perfectly well it wouldnt work but tried it anyway! Why do I do that??

Mike H

mouse pointer over cell
 
Hi,

As far as I'm aware there's no mouse_over event in excel but here's a messy
workaround that does what you want when the cell is selected.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A1:A100")) Is Nothing Then
Range("A1:A100").ClearComments
If Target.Offset(, 3).Text < "" Then
Target.AddComment
Target.Comment.Text Text:=Target.Offset(, 3).Text
End If
End If
End Sub

Mike

"Atishoo" wrote:

Can I make the contents of a variable cell (an offset cell depending on the
current date) appear when the mouse pointer hovers over a cell.
Have tried using a comment box but this seems only to display the data
directly entered and will not accept a function such as "=offset (c,0)" I
knew perfectly well it wouldnt work but tried it anyway! Why do I do that??



All times are GMT +1. The time now is 07:13 PM.

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