Hello!
I tried to modify this to get the AffectedCell.Address displayed in the msgbox, but only succeed in getting the ActiveCell.Address (and just "cell" doesn't work). What else do I need to add to this?
Sub ListObjects()
Dim objCount As Integer
Dim x As Integer
Dim objList As String
Dim objPlural As String
Dim objType(17) As String
'Set types for different objects
objType(1) = "Autoshape"
objType(2) = "Callout"
objType(3) = "Chart"
objType(4) = "Comment"
objType(7) = "EmbeddedOLEObject"
objType(8) = "FormControl"
objType(5) = "Freeform"
objType(6) = "Group"
objType(9) = "Line"
objType(10) = "LinkedOLEObject"
objType(11) = "LinkedPicture"
objType(12) = "OLEControlObject"
objType(13) = "Picture"
objType(14) = "Placeholder"
objType(15) = "TextEffect"
objType(17) = "TextBox"
objList = ""
'Get the number of objects
objCount = ActiveSheet.Shapes.Count
If objCount = 0 Then
objList = "There are no shapes on " & _
ActiveSheet.Name
Else
objPlural = IIf(objCount = 1, "", "s")
objList = "There are " & Format(objCount, "0") _
& " Shape" & objPlural & " on " & _
ActiveSheet.Name & vbCrLf & vbCrLf
For x = 1 To objCount
objList = objList & ActiveSheet.Shapes(x).Name & " at " & ActiveCell.Address & " is a " & IIf(ActiveSheet.Shapes(x).Visible = msoFalse, "Not Visible", "Visible") & " " & objType(ActiveSheet.Shapes(x).Type) & vbCrLf
Next x
End If
MsgBox (objList)
End Sub
Thanks for your help!
VR/Lost
Bookmarks