Extraer datos específicos de un xml 2

Dante y/o expertos, que tal este es un tema anterior y con varias respuestas, ¿me sirvió mucho tu macro y me gustaría modificar tu macro para agregar en el array tantas datos como quiera extraer del xml pero no encuentro como hacerlo alguna sugerencia? De antemano gracias, tu macro es la siguiente

Sub Extraccion()
'Por.Dante Amor
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set l1 = ThisWorkbook
Set h1 = l1.Sheets(1)
h1.UsedRange.Offset(1, 0).ClearContents
'
datos = Array("/cfdi:Emisor/@rfc", _
"/cfdi:Emisor/@nombre", _
"/cfdi:Receptor/@Rfc", _
"/@total", _
"/@fecha", _
"/tfd:TimbreFiscalDigital/@FechaTimbrado", _
"/@TipoDeComprobante", _
"/@Moneda", _
"/@Monto", _
"/@TipoCambio")
ruta = l1.Path & "\"
arch = Dir(ruta & "*.xml")
j = 2
k = 2
Do While arch <> ""
Set l2 = Workbooks.Open(Filename:=ruta & arch)
Set h2 = l2.Sheets(1)
h1.Cells(j, "A") = arch
For i = LBound(datos) To UBound(datos)
Set b = h2.Rows(2).Find(datos(i), lookat:=xlPart)
If Not b Is Nothing Then
h1.Cells(j, k) = h2.Cells(3, b.Column)
k = k + 1
End If
Next
l2.Close
j = j + 1
k = 2
arch = Dir()
Loop
h1.Cells.EntireColumn.AutoFit
MsgBox "Fin"
End Sub

Añade tu respuesta

Haz clic para o