Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88809

Excel VBA: How Check the Name of Picture Inside the Cell?

$
0
0

I'm writing a program in macro that will check the name of the picture in a cell, then put a value on the next column based on the name of the picture.

My program only checks if the name of the picture exists in the activesheet.

My goal is to check if the name of the picture is on this cell and then put a value on the next column based on the name of the picture. Thanks a lot.

   Sub CheckImageName()
    Dim iRowCountShapes As Integer
    Dim sFindShape As String

    iRowCountShapes = 2


    While Sheets("Data").Cells(iRowCountShapes, 1) <> ""

        If Sheets("Data").Shapes("Rock").Name = "Rock" Then

            Sheets("Data").Cells(iRowCountShapes, 3) = "Rock"

        ElseIf Sheets("Data").Shapes("Roll").Name = "Roll" Then

            Sheets("Data").Cells(iRowCountShapes, 3) = "Roll"

        Else

            Sheets("Data").Cells(iRowCountShapes, 3) = "Neither"

        End If

        iRowCountShapes = iRowCountShapes + 1

    Wend

End Sub

Viewing all articles
Browse latest Browse all 88809

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>