Results 1 to 10 of 10

Thread: Cell mouseover action

  1. #1

    Cell mouseover action



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Dear all,

    I have read many artices about not being able to show a text when hovering over a certain cell.

    On the other hand, this functionality exists directly in excel (see picture). Click image for larger version. 

Name:	Bez názvu.JPG 
Views:	18 
Size:	11.6 KB 
ID:	2140

    I only need to change the text in the box. Is there a way to do that?

    Thank you very much.

    Regards,
    joachym

  2. #2
    Acolyte patel's Avatar
    Join Date
    Feb 2014
    Location
    Italy
    Posts
    59
    Articles
    0
    Range("A1").Comment.Text Text:="my new comment"

  3. #3
    Dear patel,

    Thank you for your reply. But I am affraid that it is not a comment.

    I inserted the text using vba by entering the value in the adjacent cell and this "comment" appears itself when hovering over the cell - nevertheless, there is no red triangle in the cell corner and also the comment disappears after moving away so it cannot be changed. Moreover, it doesn't appear in 2010 only in 2003.

  4. #4
    Acolyte patel's Avatar
    Join Date
    Feb 2014
    Location
    Italy
    Posts
    59
    Articles
    0
    I'm using 2010, attach please a sample file with the code you used

  5. #5
    Case 12 'if given cell (column) selected
    If Cells(ActiveCell.Row, 1) <> "" Then 'if row record exists
    If Target = "" Then
    Target.Value = Cells(ActiveCell.Row, "M") - 1 'brings date from the adjacent cell lowered by one
    Target.Interior.ColorIndex = 41 'changed color
    '-------------------------------my attempts to show the weekday - this is my aim to show weekday when hovering over the cell-----------------------------------------
    Select Case Weekday(Target.Value, 2)
    Case 1
    sText = "Monday"
    Case 2
    sText = "Tuesday"
    Case 3
    sText = "Wednesday"
    Case 4
    sText = "Thursday"
    Case 5
    sText = "Friday"
    Case 6
    sText = "Saturday"
    Case 7
    sText = "Sunday"
    'End Select
    Target.Validation.InputMessage = sText
    'Target.AddComment sText
    'Target.Comment.Shape.ScaleWidth 5.87, msoFalse, msoScaleFromTopLeft
    'Target.Comment.Shape.ScaleHeight 2.26, msoFalse, msoScaleFromTopLeft
    '-------------------------------------------------------------------------
    Else 'if not empty change the color - this is not prety important
    If Target.Interior.ColorIndex <> 41 Then
    Target.Interior.ColorIndex = 41
    Else
    Target.Interior.ColorIndex = xlNone
    End If
    End If
    End If

    I really don't know where the popup box arises because it doesn't exist where the value input manually.

    There is no easy way to create such popup message (wih "my" information so I wanted to know whether there is a way to use "automatic" popup.

    Thanks again for your help!

  6. #6
    Acolyte patel's Avatar
    Join Date
    Feb 2014
    Location
    Italy
    Posts
    59
    Articles
    0
    I asked for xlsm file for testing

  7. #7
    Sorry, attached now.

    When you enter company name into B12, A12 is automatically filles as well as M12. After you click to L12 it will automatically insert date -1 into L12 - that's the moment of "comment" creation (not using my code). As I said, it doesn't appear in 2010!


    Thanks

  8. #8
    I need to post once more to be able to enter links....

  9. #9
    Sorry, attached now.

    When you enter company name into B12, A12 is automatically filles as well as M12. After you click to L12 it will automatically insert date -1 into L12 - that's the moment of "comment" creation (not using my code). As I said, it doesn't appear in 2010!

    https://www.dropbox.com/s/p5p0gtc24oyt9to/Task.xlsm

    Thanks

  10. #10
    Acolyte patel's Avatar
    Join Date
    Feb 2014
    Location
    Italy
    Posts
    59
    Articles
    0
    your code works on my excel 2010, i changed it to
    Code:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        
    On Error GoTo ErrHandler:
    
        Select Case Target.Column
            Case 2
                If Cells(ActiveCell.Row, 1) = "" Then
                    Cells(ActiveCell.Row, 1) = Date
                End If
                If Cells(ActiveCell.Row, "M") = "" Then
                    Cells(ActiveCell.Row, "M") = Date + 1.625
                End If
            Case 12
                If Cells(ActiveCell.Row, 1) <> "" Then
                    If Target = "" Then
                        Target.Value = Cells(ActiveCell.Row, "M") - 1
                        Target.Interior.ColorIndex = 41
                        Select Case Weekday(Target.Value, 2)
                            Case 1
                                sText = "Monday"
                            Case 2
                                sText = "Tuesday"
                            Case 3
                                sText = "Wednesday"
                            Case 4
                                sText = "Thursday"
                            Case 5
                                sText = "Friday"
                            Case 6
                                sText = "Saturday"
                            Case 7
                                sText = "Sunday"
                        End Select
                        Target.AddComment sText
                    Else
                        If Target.Interior.ColorIndex <> 41 Then
                            Target.Interior.ColorIndex = 41
                        Else
                            Target.Interior.ColorIndex = xlNone
                        End If
                    End If
                End If
            Case 14
                If Cells(ActiveCell.Row, "M") <> "" And Target = "" Then
                    Target.Value = Date + Time
                    Cells(ActiveCell.Row, "L").Interior.ColorIndex = xlNone
                End If
            Case 15
                If Cells(ActiveCell.Row, "M") <> "" And Target = "" Then
                    If Cells(ActiveCell.Row, "N") <> "" Then
                        Target.Value = Date
                    Else
                        Cells(ActiveCell.Row, "N") = Date
                        Target.Value = Date
                    End If
                End If
            Case 17
                If Cells(ActiveCell.Row, "O") <> "" And Target = "" Then
                    Target.Value = Date
                End If
        End Select
        
    ErrHandler:
        'If Err.Number = 9 Then
        'End If
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •