I’ve only just started using VBA in my workbook so I’m sure you know more about this. But the problem I had was filtering and extracting the list of bets by the market id and selection id.
Anyway managed to get it working by having a cell return “now_time” updating at every refresh (2 secs) then when that cell changes do an advanced filter. This is what I’m using
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$AD$2" Then
'Ensure target is a number
If IsNumeric(Target) Then
'Stop any possible runtime errors and halting code
On Error Resume Next
'Turn off ALL events so the Target does not _
put the code into a loop.
Application.EnableEvents = False
'for team1
Range("$A$5:$I$1000").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range("AE1:AF2"), CopyToRange:=Sheet4.Range("A100:I100"), Unique:=False
'for team2
Range("$A$5:$I$1000").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range("AQ1:AR2"), CopyToRange:=Sheet5.Range("A100:I100"), Unique:=False
'for team3
Range("$A$5:$I$1000").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range("BC1:BD2"), CopyToRange:=Sheet6.Range("A100:I100"), Unique:=False
'Turn events back on
Application.EnableEvents = True
'Allow run time errors again
On Error GoTo 0
End If
End If
End Sub
Or more simply if cell AD2 changes then run the rest of the code.
This may not answer your question, but it worked for me. I wasn’t aware you could refresh the market yourself from excel (could be wrong, it’s happened before)