link to a pic

Chris Davison

MrExcel MVP
Joined
Feb 15, 2002
Messages
1,790
Hi all,

I know how to put a pic as a comment background (ie family photo, or a landscape etc etc when the mouse hovvers over the cell)

is it possible to make it conditional on the contents of the cell ?

ie

I have a range of cells A1 to A6 containing the results from the last F1 race :

Schumacher
Montoya
Raikkonen
Irvine
Webber
Salo

can I make the comment background pic *conditional* on what's in the cell so it shows a pic of Montoya or Salo or even Jensen Button if he ever makes it into the finishing 6.....

I suspect it's a VBA solution

thanks
Chris
:)

marker schumacher
This message was edited by Chris Davison on 2002-05-19 11:51
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hello Chris,

First of all how do you add a photo as a comment? I know that a Comment object has a Shape property. Is that how you're doing it? I've never thought about using a different shape or picture for a comment but would be interested in doing so. If you can let me know then I may be able to come up with some code for doing what you want.

Regards from the metropolis known as Elephant and Castle! Laters, Dan.
 
Upvote 0
On 2002-03-09 10:34, dk wrote:
Hello Chris,

First of all how do you add a photo as a comment? I know that a Comment object has a Shape property. Is that how you're doing it? I've never thought about using a different shape or picture for a comment but would be interested in doing so. If you can let me know then I may be able to come up with some code for doing what you want.

Regards from the metropolis known as Elephant and Castle! Laters, Dan.

Dan have a look @ this thread;
http://www.mrexcel.com/board/viewtopic.php?topic=1725&forum=2&3
 
Upvote 0
Hi Chris
You can try something like this;

Right click sheet tab, select view code
Paste this code in;<Pre/>
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim rgF1 As Range

If Target.Cells.Count > 1 Then Exit Sub

Set rgF1 = Range("A1:A6")
Set rgF1 = Application.Intersect(Target, rgF1)
If Not rgF1 Is Nothing Then
CommentPict (Target.Value)
End If
End Sub</Pre>


Then in VBA module paste this code;<Pre/>

Sub CommentPict(Who)
Dim Pict As String

'Schumacher,Montoya,Raikkonen,Irvine,Webber,Salo
On Error Resume Next
ActiveCell.Comment.Delete
On Error GoTo 0

Select Case Who

Case "Schumacher"
Pict = "C:Imagesgif1xlzone[1].gif"
Case "Montoya"
Pict = "C:Imagesgif1flamewar.gif"
Case "Raikkonen"
Pict = "C:Imagesgif1xlzone[1].gif"
Case "Irvine"
Pict = "C:Imagesgif1xlzone[1].gif"
Case "Webber"
Pict = "C:Imagesgif1xlzone[1].gif"
Case "Salo"
Pict = "C:Imagesgif1xlzone[1].gif"
Case Else
Pict = ""

End Select
If (Pict = "") Then Exit Sub
With ActiveCell
.AddComment
.Comment.Visible = False
.Comment.Shape.Fill.Transparency = 0#
.Comment.Shape.Fill.UserPicture Pict
End With

End Sub</Pre>

Obviously change file names as required

[This is the Amended Version-7th April 2002]
This message was edited by Ivan F Moala on 2002-04-06 21:05
 
Upvote 0
Hi Guys, know you wont mind me stepping in

Dk Elepahant man eh! used to throw some punches down Walworth Rd and East St! Worked oppersite Barclays years back yep in there! them got moved to better clims Brixton!

Chris D
Cheers for the effort we your input is 1001 % and we will have fun F1 this season.

Ivan

BIG thanks and a tip o the hat my friend, I have predictions some guiys are doing Chris D so kindly did a sheet for us to use vert cool it is to, if you want in please email me at work and of cause join the fun, sadly no Nwe Zealand GP but as Chris for ever tells me Bruce McLaren is an NZ guy, and funny still my best mate from school is a Police Man in NZ ......

Cheers guys.... many people will have such fun and i thank you all from all of us!

Rdgs
 
Upvote 0
On 2002-03-09 11:56, Jack in the UK wrote:
Hi Guys, know you wont mind me stepping in

BIG thanks and a tip o the hat my friend, I have predictions some guiys are doing Chris D so kindly did a sheet for us to use vert cool it is to, if you want in please email me at work and of cause join the fun, sadly no Nwe Zealand GP but as Chris for ever tells me Bruce McLaren is an NZ guy, and funny still my best mate from school is a Police Man in NZ ......

Hi Jack
Possible to email me the wkbk
I have friends who would be interested
even though NO NZ..... :(

cheers Jack

your friend

Ivan
 
Upvote 0
Hi Ivan

But of cause, you can have your own game donw in New Zealand how cools that - i know Chris wont mind hell be please, i keep saying how good his work is... we all love this and it F1, i dont think ive got here, but have at work of cause.. illsent ASAP promise you taht worst Monday .. so Tuesday to you i guess ... hey love the F1 and hope your guys do too:

Take care friend, speak soon.....

PS ill send on the normal email i use to you if thats OK! form my normal sending account:

Imv very sorry cant sent now wopuld really love to!

Rdgs
 
Upvote 0
I just want to say thank you - that is a very cool feature (putting a picture in a comment)!

Learning is fun,

Russell
 
Upvote 0
Ivan !

well, I plugged in all 22 images, extended the range to row 660 and it works perfectly.

You're a star :) Thanks very much for that. I'd submit that if Jack lets you in as a player in this league, he adds a few points bonus hee hee

DK - did that thread help ? kind of groovy, you can add pix of your wife in comments etc etc LOL

Jack - I've added Ivan's code, which takes the spreadsheet on a step. I'll send it to you, as it's yours, just so we don't end up with different sheets in different stages of development around the world ! I should add though, mine was a very first draft stab at something concrete : the points awarded were per the race results, plus double for getting the prediction in the right finishing place....... still lots of development room for "jokers" and pit stops, fastest laps, etc etc..... All something to look forward to :)

Lastly, yeppers, Bruce McLaren *was* a kiwi, sadly dead now. One of his original technical team was Ron Dennis, who worked his way up through the 70s and 80s to Team Owner, so the original Kiwi driving force and pedigree isn't all lost.

(edit - nearly forgot : when you send it, don't forget all the image files...)

Thanks again Ivan

Chris
:)
This message was edited by Chris Davison on 2002-03-10 05:43
 
Upvote 0
Also wanted to say Cheers to everyone - the normally dull budget/forecast workbooks I prepare will now be livened up by comments with Rachel from S Club 7 as background :)

Regards,
Dan
 
Upvote 0

Forum statistics

Threads
1,214,429
Messages
6,119,433
Members
448,897
Latest member
ksjohnson1970

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