MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Mar 9th, 2002, 08:20 AM   #1
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

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 ]
Chris Davison is offline   Reply With Quote
Old Mar 9th, 2002, 11:34 AM   #2
dk
MrExcel MVP
 
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 2,908
Default

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.
dk is offline   Reply With Quote
Old Mar 9th, 2002, 12:22 PM   #3
Ivan F Moala
MrExcel MVP
 
Ivan F Moala's Avatar
 
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
Default

Quote:
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/viewtop...1725&forum=2&3
Ivan F Moala is offline   Reply With Quote
Old Mar 9th, 2002, 12:45 PM   #4
Ivan F Moala
MrExcel MVP
 
Ivan F Moala's Avatar
 
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
Default

Hi Chris
You can try something like this;

Right click sheet tab, select view code
Paste this code in;


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



Then in VBA module paste this code;



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



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 ]
Ivan F Moala is offline   Reply With Quote
Old Mar 9th, 2002, 12:56 PM   #5
Jack in the UK
Board Regular
 
Join Date: Feb 2002
Posts: 3,065
Default

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

__________________
Free Excel based Web Toolbar available here.

Jack in the UK
J & R Excel Solutions
"making Excel work for you"
Jack in the UK is offline   Reply With Quote
Old Mar 9th, 2002, 01:02 PM   #6
Ivan F Moala
MrExcel MVP
 
Ivan F Moala's Avatar
 
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
Default

Quote:
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
Ivan F Moala is offline   Reply With Quote
Old Mar 9th, 2002, 01:24 PM   #7
Jack in the UK
Board Regular
 
Join Date: Feb 2002
Posts: 3,065
Default

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

__________________
Free Excel based Web Toolbar available here.

Jack in the UK
J & R Excel Solutions
"making Excel work for you"
Jack in the UK is offline   Reply With Quote
Old Mar 9th, 2002, 04:40 PM   #8
Russell Hauf
MrExcel MVP
 
Russell Hauf's Avatar
 
Join Date: Feb 2002
Location: Portland, OR USA
Posts: 1,374
Default

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

Learning is fun,

Russell
Russell Hauf is offline   Reply With Quote
Old Mar 10th, 2002, 06:36 AM   #9
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

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 ]
Chris Davison is offline   Reply With Quote
Old Mar 10th, 2002, 06:54 AM   #10
dk
MrExcel MVP
 
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 2,908
Default

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
dk is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 04:43 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes