When you insert a picture into a excel worksheet, you get automatically Picture 1, Picture 2, and so forth...... I have a function when a picture is selected to put black border around it. Problem is, if I have two picture on worksheet that is named Picture 1, the function will not know which picture 1 to put the border around thus may put border around the incorrect selected image.
Here's my code to put border on image:
Private Function AddImageBorder(WhichSheet As String)
With ActiveWorkbook.Sheets(WhichSheet).Shapes(Selection.Name)
.Line.Weight = 5
.Line.Visible = msoTrue
End With
End Function