Quantcast
Channel: Excel IT Pro Discussions forum
Viewing all articles
Browse latest Browse all 11829

Using a pictable and cell value to determine photos to show up

$
0
0

I currently have a PicTable setup to show certain pictures in a document. This is the vba code used below:

Private Sub Worksheet_Calculate()
        Dim oPic As Picture
        Me.Pictures.Visible = False
        With Range("A217")
            For Each oPic In Me.Pictures
                If oPic.Name = .Text Then
                    oPic.Visible = True
                    oPic.Top = .Top
                    oPic.Left = .Left
                    Exit For
                End If
            Next oPic
        End With
    End Sub

My problem is that I had a photo in cell "A1" as well that I did not want to hide and is now hidden (it is "picture 1" if that helps) how can I make sure that the VBA code above does not hide this specific photo ever and also accomplish what the VBA code is doing now?

Any help anyone can provide would be much appreciated!!


Dustin Shepard


Viewing all articles
Browse latest Browse all 11829

Trending Articles