.
:)
Esa página es ineficiente y -encima- no te brinda la info en un formato de tabla "real". Por ello vas a tener que resolver el tema con "cirugía mayor" (una macro) como la que adjunto:
Sub extrae_Datos()
Dim xml, HtmlDoc, mZI, mDiv, iDiv, ws As Worksheet
Dim Url, Dic, i&, j%, C As Range
Application.ScreenUpdating = False
Url = "http://asobal.es/equipos_estadisticas_equipo.php"
Set xml = CreateObject("Microsoft.XMLHttp")
xml.Open "Get", Url, False 'petición sincrónica
xml.Send
Set HtmlDoc = CreateObject("HTMLFile")
HtmlDoc.body.innerHTML = caracteres_Especiales(xml.responseBody)
Set mZI = HtmlDoc.getElementByID("zona_izquierda")
Set mDiv = mZI.getElementsByTagName("div")
Set Dic = CreateObject("Scripting.Dictionary")
i = 0
For Each iDiv In mDiv
i = 1 + i
Set Dic(i) = iDiv
Next
Set ws = Workbooks.Add.Sheets(1)
ws.[a1] = "JUGADORES DE CAMPO"
i = 1
Do
If i >= Dic.Count Then Exit Do
Do Until Dic(i).ID = "fila_1_listado_jugadores" And Trim(Dic(i).innerText) <> ""
i = 1 + i
DoEvents
Loop
Set C = ws.Cells(Rows.Count, "a").End(xlUp)
C.Cells(2, 1) = Dic(i).innerText
j = 0
Do Until j = 9
i = 1 + i
Do Until Dic(i).ID = "cabecera_listado_jugadores" And Trim(Dic(i).innerText) <> ""
i = 1 + i
DoEvents
Loop
j = 1 + j
C.Cells(2, 1 + j) = Dic(i).innerText
Loop
i = 1 + i
DoEvents
Loop
With ws.[a1].CurrentRegion
.Columns("g:j").NumberFormat = "0;;""---"""
.Columns.AutoFit
With .Rows(1)
.HorizontalAlignment = xlCenterAcrossSelection
.Font.Size = 14
.Offset(1).Insert
End With
End With
Set C = ws.Columns(2).Find("L 9M", After:=ws.[b5], LookIn:=xlValues, LookAt:=xlWhole).Offset(, -1)
C.EntireRow.Insert
C.EntireRow.Insert
With C.CurrentRegion
C(1).Offset(-1) = "ARQUEROS"
With .Rows(1).Offset(-1)
.HorizontalAlignment = xlCenterAcrossSelection
.Font.Size = 14
.Offset(1).Insert
End With
End With
With ws.ListObjects.Add(xlSrcRange, ws.[a3].CurrentRegion, , xlYes)
.TableStyle = "TableStyleMedium15"
.Range.AutoFilter
End With
With ws.ListObjects.Add(xlSrcRange, C.CurrentRegion, , xlYes)
.TableStyle = "TableStyleMedium15"
.Range.AutoFilter
End With
Application.ScreenUpdating = True
End Sub
Private Function caracteres_Especiales(mTxt) As String
With CreateObject("ADODB.Stream")
.Type = 1 ' adTypeBinary
.Open
.Write mTxt
.Position = 0
.Type = 2 ' adTypeText
.Charset = "iso-8859-1"
caracteres_Especiales = .ReadText
End With
End Function
Espero te sea de utilidad, Mario (Cacho) Rodríguez.
:)
.