Moderatori: Anthony47, Flash30005
=SOSTITUISCI(SINISTRA(B20;2);"-";"")-SOSTITUISCI(DESTRA(B20;2);"-";"")
=SE(1*SOSTITUISCI(SINISTRA(B20;2);"-";"")>1*SOSTITUISCI(DESTRA(B20;2);"-";"");1;SE(1*SOSTITUISCI(SINISTRA(B20;2);"-";"")=1*SOSTITUISCI(DESTRA(B20;2);"-";"");"x";2))
La funzione Stringa.Estrai per definizione lavora su testi, quindi il discorso non regge.ho provato ad usare la stringa.estrai ma non funziona. perchè la stringa.estrai non riconosce il formato testo mentre generale o numeri si
=SINISTRA(C2;1)
=DESTRA(C2;1)
Selection.QueryTable.Refresh BackgroundQuery:=False
Sub QTRefreshAll()
For i = 1 To Worksheets.Count
Sheets(i).Select
mmm = ""
aaa = ActiveSheet.QueryTables.Count
For j = 1 To aaa
mmm = mmm & ActiveSheet.QueryTables(j).Destination.Address & "_"
ActiveSheet.QueryTables(j).Refresh BackgroundQuery:=False
Next j
Debug.Print i & " - " & aaa & mmm
Next i
End Sub
Sub GetTabbbSub(ByVal myURL As String)
'Va Chiamata passandogli l'URL da leggere
'myURL = "http://www.nhl.com/stats/team?reportType=game&report=teamsummary&season=20152016&gameType=2&aggregate=1&gameLocation=H"
Set ie = CreateObject("InternetExplorer.Application")
With ie
.navigate myURL
.Visible = True
Do While .Busy: DoEvents: Loop 'Attesa not busy
Do While .readyState <> 4: DoEvents: Loop 'Attesa documento
End With
'
myStart = Timer 'attesa addizionale
Do
DoEvents
If Timer > myStart + 2 Or Timer < myStart Then Exit Do
Loop
'Leggi le tabelle SUL FOGLIO ATTIVO
''Sheets("Classifica Home").Select
''Cells.Clear
Set mycoll = ie.document.getElementsByTagName("TABLE")
For Each myItm In mycoll
For Each trtr In myItm.Rows
For Each tdtd In trtr.Cells
Cells(i + 1, j + 1) = tdtd.innerText
j = j + 1
Next tdtd
i = i + 1: j = 0
Next trtr
i = i + 1
Next myItm
''Stop 'Vedi testo
'Chiusura IE
ie.Quit
Set ie = Nothing
End Sub
Sub Agg_Classifica_Home()
Sheets("Classifica Home").Select
Cells.ClearContents
Call GetTabbbSub("http://www.nhl.com/stats/team?reportType=game&report=teamsummary&season=20152016&gameType=2&aggregate=1&gameLocation=H")
End Sub
Sub Agg_Schedule()
Sheets("Schedule").Select
Cells.ClearContents
Call GetTabbbSub("http://stats.betradar.com/s4/?clientid=1271&language=en#2_4,3_37,22_2,5_11202,9_fixtures,231_full,23_3")
End Sub
Private Sub Workbook_Open()
Call Agg_Classifica_Home
Call Agg_Schedule
Call Agg_AltroFoglio
Call Agg_AltroFoglioAncora
'etc etc
'etc etc
'
Call QTRefreshAll
End Sub
Sub Agg_Classifica_Home()
Sheets("Classifica Home").Select
Cells.ClearContents 'Azzera il foglio
'Importa da col A da primo Url:
Call GetTabbbSub("http://www.nhl.com/stats/team?reportType=game&report=teamsummary&season=20152016&gameType=2&aggregate=1&gameLocation=H")
'Sposta la prima importazione a col T e successive:
Columns("A:U").Insert Shift:=xlToRight
'Importa da colonna A da secondo Url:
Call GetTabbbSub("http://www.nhl.com/stats/team?reportType=game&report=teamsummary&season=20152016&gameType=2&aggregate=1&gameLocation=H")
End Sub
Torna a Applicazioni Office Windows
Inserire dati filtrati da 2 file ad un terzo file Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 14 |
Perchè l'importazione dati con Selenium non fuziona? Autore: aggittoriu |
Forum: Applicazioni Office Windows Risposte: 7 |
copia di dati da un file chiuso e elaborazione Autore: luca62 |
Forum: Applicazioni Office Windows Risposte: 2 |
Visitano il forum: Nessuno e 11 ospiti