Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: link to a pic

  1. #1
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Millbank, London, UK
    Posts
    1,790
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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 ]

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Sydney, Australia
    Posts
    2,940
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    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.

  3. #3
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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

  4. #4
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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 ]

  5. #5
    Board Regular
    Join Date
    Feb 2002
    Posts
    3,184
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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"

  6. #6
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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

  7. #7
    Board Regular
    Join Date
    Feb 2002
    Posts
    3,184
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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"

  8. #8
    MrExcel MVP Russell Hauf's Avatar
    Join Date
    Feb 2002
    Location
    Portland, OR Area - USA
    Posts
    1,607
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

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

    Learning is fun,

    Russell

  9. #9
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Millbank, London, UK
    Posts
    1,790
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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 ]

  10. #10
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Sydney, Australia
    Posts
    2,940
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    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

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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