Tootip with vlookup

simon_ives

New Member
Joined
Jul 12, 2014
Messages
9
Hi all.

I'm wondering if anyone can share a method to add a tooltip that displays the results of a vlookup?

For example, I have a large vehicle tracking spreadsheet with a variety of worksheets for collating monthly data on logbook page numbers, KMs travelled, private usage, missing KMs, etc. What I'd like to do is have a tooltip appear over certain cells on one worksheet that displays the vehicle's contact person's name, as pulled from the vehicle details worksheet.

At the moment we can either add a new row and include a vlookup, but this adds too much duplicate data as the information is present on another worksheet. Or we just navigate to the vehicle details worksheet and search for the vehicle via the rego number.

Thanks in advance.
 
Sorry Michael - thought you missed post #7 while you were replying in post #8.
 
Upvote 0

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Man, I miss lots of stuff....Seniors moments are the main cause...(y)
 
Upvote 0
Thanks for the assistance.

Unfortunately, I've added the code and I'm still not getting any comments.

I have the following code in the worksheet:

Code:
Sub Worksheet_Change(ByVal Target As Range)
If Not (Target.Comment Is Nothing) Then Target.Comment.Delete
If Target.Count > 1 Then Exit Sub
 If Intersect(Target, Range("C6:C69")) Is Nothing Then Exit Sub 'change cell range to suit
        With Target.AddComment
        .Text "The Contact Person for This Vehicle is " & _
            WorksheetFunction.VLookup(Target.Offset(0, -2), Sheets("Vehicle information").Range("$A$2:$F$72"), _
            5, False)
        End With
End Sub

The contents of column "C" is text values output from a VLOOKUP. for example, "C6" has the text "ACAT" derived from the following VLOOKUP:

Code:
=VLOOKUP(A6,'Vehicle information'!$A$2:$F$72,4,FALSE)

Thanks again.
 
Upvote 0
Have you tried stepping through manually.
At each step you can hover over a particular item and it should provide the expected outcome.

Are you getting bad data or actual errors or nothing at all
AND
I don't have Excel at the moment, but shouldn't this
Code:
If Not (Target.Comment Is Nothing)
be
Code:
If Not (Target.Comment) Is Nothing
 
Upvote 0
Thanks for the reply Michael.

No, I just get nothing.

If I change the parentheses, as you suggested, I get an error (Compile Error: Syntax Error). When I change the code back I get nothing again.

I assume that the code is executing without error, I guess it's just not triggering the insertion of a comment.
 
Upvote 0
Can you share the workbook ??
If so, send me a PM
 
Upvote 0

Forum statistics

Threads
1,216,525
Messages
6,131,183
Members
449,630
Latest member
parkjun

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top