I’ve been playing around with adapting the 2 shape routines below to return results as one;
With this from Norie
VBA Shape Node Points x position
and "DetermineShapeType" from "The SpreadsheetGuru";
VBA Coding For Shapes (The Complete Guide)
My code code todate is this.
My trouble is I can’t fathom out how to display the 2 results in the message box in the way I want them to appear.
This is the result of my code above at combining them todate.
BUT I want Msg box to display as,
Note; when code is run it does default to the error handler at the end of the routine, which I need to address in some way
With this from Norie
VBA Shape Node Points x position
and "DetermineShapeType" from "The SpreadsheetGuru";
VBA Coding For Shapes (The Complete Guide)
My code code todate is this.
VBA Code:
Option Explicit
' Combining "Determine Shape Type" with "Get Points"
Sub MeDetermineShapeTypeGetPoints()
Dim sh As Variant
Dim nd As Variant
Dim xy As Variant
Dim nodemsg As String
Dim I As Variant
Dim ActiveShape As Shape
Dim UserSelection As Variant
'Pull-in what is selected on screen
Set UserSelection = ActiveWindow.Selection
'Determine if selection is a shape
On Error GoTo NoShapeSelected
Set ActiveShape = ActiveSheet.Shapes(UserSelection.Name)
On Error Resume Next
Set sh = ActiveShape 'ActiveWindow.Selection
For Each nd In sh.Nodes
xy = nd.Points
I = I + 1
nodemsg = nodemsg & "The Select Shape Type = " & ActiveShape.AutoShapeType & vbLf & "Node " & I & ": x =" & xy(1, 1) & " y=" & xy(1, 2) & vbCrLf
Next
MsgBox nodemsg
'Error Handler
NoShapeSelected:
MsgBox "You do not have a shape selected!"
End Sub
My trouble is I can’t fathom out how to display the 2 results in the message box in the way I want them to appear.
This is the result of my code above at combining them todate.
BUT I want Msg box to display as,
Rich (BB code):
The Selected Shape Type = 138
Node 1:x=205.2y=879.2
Node2 ........
Node3.........
etc