How to link images to cells, so that when filter is applied images will also get hidden along with corresponding cells.
Thanks.
How to link images to cells, so that when filter is applied images will also get hidden along with corresponding cells.
Thanks.
You will need to name your images and maybe create a table - i then usedto get the name of the image i wanted to appear and then used this code to call only that image to be placed in cell W50. I also named the images on the sheet which I didn't want to appear/disapper Bob so the code ignored them=VLOOKUP(E3,PicTbl,1,0)
Private Sub Worksheet_Calculate() Dim oPic As Object Dim shpTemp As Shape Dim strName As String For Each shpTemp In Me.Shapes If shpTemp.Type = msoPicture Then If StrComp(Left(shpTemp.Name, 3), "BOB") = 0 Then ' ignore Bob's! Else shpTemp.Visible = False End If End If Next With Range("W50 ") strName = Trim(.Value) If Len(strName) > 0 Then Set oPic = Me.Pictures(strName) oPic.Visible = True oPic.Top = .Top oPic.Left = .Left End If End With End Sub
Blake 7
If your question has been answered, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
If any member's response has helped to solve your problem, please consider using the scales icon on the top right of their post to show your appreciation.
http://failblog.org/
You will need to name your images and maybe create a table - i then usedto get the name of the image i wanted to appear and then used this code to call only that image to be placed in cell W50. I also named the images on the sheet which I didn't want to appear/disapper Bob so the code ignored them=VLOOKUP(E3,PicTbl,1,0)
Private Sub Worksheet_Calculate() Dim oPic As Object Dim shpTemp As Shape Dim strName As String For Each shpTemp In Me.Shapes If shpTemp.Type = msoPicture Then If StrComp(Left(shpTemp.Name, 3), "BOB") = 0 Then ' ignore Bob's! Else shpTemp.Visible = False End If End If Next With Range("W50 ") strName = Trim(.Value) If Len(strName) > 0 Then Set oPic = Me.Pictures(strName) oPic.Visible = True oPic.Top = .Top oPic.Left = .Left End If End With End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks