Mega Code Archive

 
Categories / VisualBasic Script / XML
 

Find by string value

Sub FindNode()            Dim oXmlDoc As DOMDocument            Dim oXmlNode As IXMLDOMNode            Set oXmlDoc = New DOMDocument            oXmlDoc.async = False            oXmlDoc.Load (ThisWorkbook.Path & "\EmployeeSales.xml")            Set oXmlNode = oXmlDoc.SelectsingleNode ("//FirstName[text()='Mike']")            Debug.Print oXmlNode.XML End Sub