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

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
DK and Chris --- your sick men i tell you!

Me i would have amonated Excel XP logo but then as you know i am sad git boaring and talantless.

Such is my part of South London!

On pulling you leg guys...

Cheers Chris. Ivan has paln down uners for his guys so i have a sneeky my old pal will compeat his guys in NZ against our UK pals in a stand off, thier compitition against us.

Ivans dead on and knows the rule FIA rules and Ivan a man of honesty so tell you this FUN FUN FUN how cool; is that.!
 
Upvote 0
Ivan (or anybody else), can you explain what the Target variable in the following line does:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

It is obviously grabbing some sort of range address but is it the active cell, the active sheet or what? And I take it this macro is acivated as soon as a user does *anything* in the sheet?

Thanks

Penfold
 
Upvote 0
On 2002-03-11 00:03, Penfold wrote:
Ivan (or anybody else), can you explain what the Target variable in the following line does:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

It is obviously grabbing some sort of range address but is it the active cell, the active sheet or what? And I take it this macro is acivated as soon as a user does *anything* in the sheet?

Thanks

Penfold

It is indeed the Activecell of the Activesheet
It is a Event procedure...A selection change
procedure applicable to the sheet the code resides in.
So when a user changes selection either by
cursoring to or clicking on or tabing to a
diff cell this Event fires....


Ivan
 
Upvote 0
Thanks Ivan. I tried out the code and was impressed with the results, except that it bombs if you select a range of cells with the mouse - presumably because the macro relies on adding notes on a cell by cell basis.

Anyway, its given me plenty of ideas to experiment with! Thanks again.

Penfold
 
Upvote 0
On 2002-03-11 01:11, Penfold wrote:
Thanks Ivan. I tried out the code and was impressed with the results, except that it bombs if you select a range of cells with the mouse - presumably because the macro relies on adding notes on a cell by cell basis.

Anyway, its given me plenty of ideas to experiment with! Thanks again.

Penfold

For the event code change to this

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


Ivan
 
Upvote 0
Dear Ivan,

I have tried your code, but it gives me an error "Compile error: Argument not optional" on this line in the code:
".Comment.Shape.Fill.UserPicture Pict"

Would you please help me.
Thanks
Askar
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

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