Gruppe
Dialog
Problem
Beim Überfahren einer Grafik mit der Maus soll die aktuelle Uhrzeit als Kommentar angezeigt. werden.
ClassModule: DieseArbeitsmappe
Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
Application.DisplayCommentIndicator = _
ThisWorkbook.Worksheets(1).Range("IV1").Value
On Error GoTo 0
End Sub
Private Sub Workbook_Open()
ThisWorkbook.Worksheets(1).Range("IV1").Value = _
Application.DisplayCommentIndicator
Application.DisplayCommentIndicator = xlCommentAndIndicator
End Sub
ClassModule: Tabelle1
Dim bln As Boolean
Private Sub Image1_MouseMove( _
ByVal Button As Integer, _
ByVal Shift As Integer, _
ByVal X As Single, _
ByVal Y As Single)
Dim rng As Range
Set rng = Image1.TopLeftCell
If X > 0 And X < 59 And Y > 0 And Y < 24.5 Then
If rng.Comment Is Nothing And bln = False Then
rng.AddComment Format(Time, "hh:mm:ss")
rng.Comment.Shape.TextFrame.AutoSize = True
bln = True
End If
Else
If Not rng.Comment Is Nothing Then
rng.Comment.Delete
bln = False
End If
End If
End Sub