Plotweaver
New Member
- Joined
- Jan 28, 2018
- Messages
- 23
I need to identify a shape's name by knowing only its top and left location data.
It is obviously possible to find a selected shape's location and name.: (Example 1: find shapes.)
Dim activeshape As Shape, UserSelection As Variant
Set UserSelection = ActiveWindow.Selection
On Error GoTo NoShapeSelected
Set activeshape = ActiveSheet.Shapes(UserSelection.Name)
On Error Resume Next
MsgBox "You have selected:" & activeshape.Name & "; Top: " & activeshape.top & "; Left: " & activeshape.left
Exit Sub
NoShapeSelected:
MsgBox "You do not have a shape selected!"
But is there a way to find the name of a shape with only its location known?: (Example 2: find shape name)
Set shp = Application.ActiveSheet.Shapes(name)
shp.top = 84
shp.left = 114
Range("A1") = name
Thank you for any information you can offer to resolve this.
It is obviously possible to find a selected shape's location and name.: (Example 1: find shapes.)
Dim activeshape As Shape, UserSelection As Variant
Set UserSelection = ActiveWindow.Selection
On Error GoTo NoShapeSelected
Set activeshape = ActiveSheet.Shapes(UserSelection.Name)
On Error Resume Next
MsgBox "You have selected:" & activeshape.Name & "; Top: " & activeshape.top & "; Left: " & activeshape.left
Exit Sub
NoShapeSelected:
MsgBox "You do not have a shape selected!"
But is there a way to find the name of a shape with only its location known?: (Example 2: find shape name)
Set shp = Application.ActiveSheet.Shapes(name)
shp.top = 84
shp.left = 114
Range("A1") = name
Thank you for any information you can offer to resolve this.