title: Read XML using VBA Excel Macro and customize the generated table
body: <p>I am new to Excel VBA. My problem is that I have an XML file and I need to show its contents in a tabular format in Excel.</p>
  
  <p>I have written a sample VBA code as follows:</p>
  
  <pre><code>Dim testFile As Workbook
  
  Set testFile = Workbooks.OpenXML(
  Filename:="D:\sample.xml",LoadOption:=XlXmlLoadOption.xlXmlLoadImportToList)
  </code></pre>
  
  <p>It generates the contents in a tabular format in Excel, but there are a lot of empty cells and some garbage data (data relevant in XML but not needed here). I need to delete the empty cells (both in rows and columns) and also remove some unwanted columns.</p>
  
  <p>Can someone please suggest some approach on how to proceed in this?</p>