apri il visual basic e in un modulo inserisci questa/e macro
- Codice: Seleziona tutto
Sub Qweb()
Range("A1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.datasport.it/pbpds/seried/temporeale20.asp", Destination:= _
Range("A1"))
.Name = "temporeale20_3"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "3,4"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Call Sostituisci
End Sub
Sub Sostituisci()
UR = ActiveSheet.Cells(Rows.Count, 2).End(xlUp).Row
For I = 1 To UR
ValCella = Cells(I, 2).Value
If Mid(ValCella, 3, 1) = "/" Then
Cells(I, 2).Value = "'" & Mid(ValCella, 2, 1) & " - " & Mid(ValCella, 5, 1)
End If
Next I
End Sub
In
UR = ActiveSheet.Cells(Rows.Count, "NumeroTuaColonna").End(xlUp).Row
cambi il numero della tua colonna (io prevedevo colonna B = 2)
cambi il numero di colonna anche qui
ValCella = Cells(I, "NumeroTuaColonna").Value
Prova avviando "Qweb" e fai sapere
Ciao