• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Total nodes from freeforms

Visor

Member
Dear friends of the forum, I've stalled about freeforms. I have a macro that performs a freeform drawing has a certain number of nodes and I would like to know the number of these nodes using VBA macros.
Upload a file to an example of what I require.
They must prove directly the drawing done because it has a name that varies by clicking on the button and the other Drawfreeform not work #nodes button.

That is when opening the file directly click #nodes

The button shows me #nodes nodes, but what I want you to show me only the total of nodes, such as "Total nodes: 300"
I appreciate your cooperation in advance
 

Attachments

How about the last line below:

Code:
Sub GetNumero_de_nodos()
Dim sh
Dim nd
Dim xy
Dim nodemsg As String
Dim I
Dim a
  Set sh = ActiveSheet.Shapes("FreeForm 5")
  
  For Each nd In sh.Nodes
  xy = nd.Points
  w = xy(1, 1)
  Z = xy(1, 2)
  'a = 0
  I = I + 1
  nodemsg = nodemsg & "Total de nodos " & "  I" & w + Z & vbCrLf
  
  Next
  MsgBox nodemsg
  MsgBox "Total Nodes: " + CStr(sh.Nodes.Count)

End Sub

If you have multiple shapes you will need to loop through them all and sum them up as you go
 
Back
Top