Calendar tooltip

samc2696

New Member
Joined
Jul 16, 2018
Messages
42
Hi all,


I have a month-by-month calendar in an excel spreadsheet, that currently fills the cell with the event title (based of a table of event data).


What I really want to achieve is that when the user clicks on the cell, a window/textbox will appear with more details of that event in. I would really like to be able to format this text box in a style that matches the calendar too.


Unfortunately the work is confidential, but I should be able to work with the code, I just do not know how to start it.


Many thanks
Sam
 
I think that this lookup formula should work for you where cell A1 is a cell in your calendar containing the Event Title to look up
(amend G to the last column in your table)
=VLOOKUP(A1,'Event Data'!A:G,2,0)

VLOOKUP looks for a match for A1 in first column of Event_Data columns A:G (ie column A) and returns the value in 2nd column

Amend VBA
Test the formula in Excel first and (assuming it returns the correct value) ...

replace
Code:
 .Value = Target.Value & vbCr & DetailsFromCalendar
with
Code:
On Error Resume Next
.Value = WorksheetFunction.VLookup(target, Sheets("Event Data").Range("A:[COLOR=#ff0000]G[/COLOR]"), 2, 0)
remembering to replace G with the last column in your table

On Error Resume Next prevents code crashing if Title is not found
- you may think that should never happen but one day it will!! :eeek:
 
Last edited:
Upvote 0

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
That has worked perfectly, thank you very much.

One final thing - and I do not think this is possible, as I have been all over the internet looking. Can I change the format of each line in the textbox? I am using vbCrLf in-between each lookup so I have more than just the event type in the tooltip box, but I would like that to be in one format, and then another piece of info in a different format.

I have seen a few examples, but nothing seems to work.

Not to worry if not, thank you all the same!
 
Upvote 0
How about several textboxes
- one for each event element
- each element formatted as you please
- they can be "trained" to appear as one object or displayed separately etc
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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