title: VBA makro to format XML in Excel to CSV
body: <p>I need to reformat a XML file to .CSV.
  I already opened the XML in Excel and did a little formating but now I really need to write a macro to get the data into shape. I already started bu I really have issues with the loop logic.</p>
  
  <p>the List has a couple thousand Articles with a variable amount of subarticles.
  each subarticle as a the same amount of properties but not every article has the same properties.</p>
  
  <p><a href="https://picload.org/image/ipialic/now.jpg" rel="nofollow">https://picload.org/image/ipialic/now.jpg</a></p>
  
  <p><a href="https://picload.org/image/ipialip/then.jpg" rel="nofollow">https://picload.org/image/ipialip/then.jpg</a></p>
  
  <p>My Code up till now looks like this:</p>
  
  <pre><code>    Option Explicit
  Dim rowCount As Long, articleCount As Long, propertyCount As Integer, name As String
  
  Sub Sortfunction()
  rowCount = 1
  articleCount = 0
  propertyCount = 0
  
  Do While Sheets("Test").Cells(rowCount, 1).Value &lt;&gt; "end"
  
      If Cells(rowCount, 1).Value = "Reference" Then
          rowCount = rowCount + 1
  
          Do While Cells(rowCount, 3).Value = ""
              If Cells(rowCount, 3).Value = "4" Then
  
              End If
          articleCount = articleCount + 1
          Loop
  
          articleCount = articleCount + 1
      End If
  rowCount = rowCount + 1
  Loop
  
  Sheets("result").Cells(1, 1).Value = rowCount
  Sheets("result").Cells(2, 1).Value = articleCount
  
  End Sub
  </code></pre>
  
  <p>At the end of the document i wrote the "end" to have a hook to stop the loop.</p>
  
  <p>Can anyone provide some help? I'm really not the best programmer :-/
  I'd really appreciate any help I can get :-)</p>