Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You may build your own VBA macro. Like this one. And add a reference to Microsoft.xml.</p> <pre><code>Sub makeXml() ActiveCell.SpecialCells(xlLastCell).Select Dim lastRow, lastCol As Long lastRow = ActiveCell.Row lastCol = ActiveCell.Column Dim iRow, iCol As Long Dim xDoc As New DOMDocument Dim rootNode As IXMLDOMNode Set rootNode = xDoc.createElement("Root") Dim rowNode As IXMLDOMNode Dim colNode As IXMLDOMNode 'loop over the rows For iRow = 2 To lastRow Set rowNode = xDoc.createElement("Row") 'loop over the columns For iCol = 1 To lastCol If (Len(ActiveSheet.Cells(1, iCol).Text) &gt; 0) Then Set colNode = xDoc.createElement(GetXmlSafeColumnName(ActiveSheet.Cells(1, iCol).Text)) colNode.Text = ActiveSheet.Cells(iRow, iCol).Text rowNode.appendChild colNode End If Next iCol rootNode.appendChild rowNode Next iRow xDoc.appendChild rootNode fileSaveName = Application.GetSaveAsFilename( _ fileFilter:="XML Files (*.xml), *.xml") xDoc.Save (fileSaveName) set xDoc = Nothing End Sub Function GetXmlSafeColumnName(name As String) Dim ret As String ret = name ret = Replace(ret, " ", "_") ret = Replace(ret, ".", "") ret = Replace(ret, ",", "") ret = Replace(ret, "&amp;", "") ret = Replace(ret, "!", "") ret = Replace(ret, "@", "") ret = Replace(ret, "$", "") ret = Replace(ret, "#", "") ret = Replace(ret, "%", "") ret = Replace(ret, "^", "") ret = Replace(ret, "*", "") ret = Replace(ret, "(", "") ret = Replace(ret, ")", "") ret = Replace(ret, "-", "") ret = Replace(ret, "+", "") GetXmlSafeColumnName = ret End Function </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload