Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to add a picture to a cell that will appear when the user clicks on
the "picture" cell. For example, a list of parts, that shows the picture of the part when it is clicked on. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I assume you have already named your pictures as the part number as in th
"picture cells" Try the following in the sheet module (rt-click sheet tab, view code). Change C3:C11 to the range of your picture cells, a named range perhaps. Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim pic As Picture On Error GoTo errExit Me.Pictures.Visible = False If Not Intersect(Range("C3:C11"), Target(1)) Is Nothing Then Set pic = Me.Rectangles(Target(1).Value) If Not pic Is Nothing Then With Target(1) pic.Left = .Left + .Width - 2 pic.Top = .Top + 2 pic.Visible = True End With End If End If errExit: End Sub Regards, Peter T "mikef255" wrote in message ... I want to add a picture to a cell that will appear when the user clicks on the "picture" cell. For example, a list of parts, that shows the picture of the part when it is clicked on. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Peter T" wrote: I assume you have already named your pictures as the part number as in th "picture cells" Try the following in the sheet module (rt-click sheet tab, view code). Change C3:C11 to the range of your picture cells, a named range perhaps. Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim pic As Picture On Error GoTo errExit Me.Pictures.Visible = False If Not Intersect(Range("C3:C11"), Target(1)) Is Nothing Then Set pic = Me.Rectangles(Target(1).Value) If Not pic Is Nothing Then With Target(1) pic.Left = .Left + .Width - 2 pic.Top = .Top + 2 pic.Visible = True End With End If End If errExit: End Sub Regards, Peter T "mikef255" wrote in message ... I want to add a picture to a cell that will appear when the user clicks on the "picture" cell. For example, a list of parts, that shows the picture of the part when it is clicked on. Thanks Peter, That worked perfect!!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how pdf picture appears when copying and pasting one sheet to anot | Excel Discussion (Misc queries) | |||
Upon mouse click a checkmark appears in a square. | Excel Programming | |||
Disabling click and right-click on the Picture I inserted in an Excel document | Excel Worksheet Functions | |||
'Unprotect' dialog box appears on every click | Excel Discussion (Misc queries) | |||
insert a picture into a comment box so that it appears/hides simi. | Excel Discussion (Misc queries) |