user2817127
user2817127

Reputation: 21

How can I get the names of Pictures on an Excel sheet into a VBA variable(s)

In Excel I can use the selection pane to ascertain the names of pictures. How can I get those names into the vba layer?

Upvotes: 0

Views: 3480

Answers (1)

BigBen
BigBen

Reputation: 50008

I assume you're looking for something like this:

Sub Test()
    Dim shp As Shape
    Dim shpName As String

    For Each shp In ActiveSheet.Shapes
        If shp.Type = msoPicture Then
            shpName = shp.Name
            Debug.Print shpName
        End If
    Next shp
End Sub

Upvotes: 2

Related Questions