Private Sub Worksheet_Change(ByVal Target As Range) problem

Please post any questions regarding the program here.

Moderator: 2020vision

Private Sub Worksheet_Change(ByVal Target As Range) problem

Postby zingomax » Thu May 31, 2012 10:04 pm

Hi

I am trying to run the code below which is based on a signal to change to a new market once the current one has closed and one other condition based on the time to off being positive still.
. It is not working and I think it is because the
Private Sub Worksheet_Change(ByVal Target As Range) part is looking for change in the 16 columns of data before running which of course has stopped because the market is closed

Is there another way to make the code run regularly without the 16 column update requirements?

_______________
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Columns.Count <> 16 Then Exit Sub
Application.EnableEvents = False

If Range("F36").Value = 2 Then
Range("Q2").Value = -1
Else: Range("Q2").Value = ""

Application.EnableEvents = True
End Sub
zingomax
 
Posts: 18
Joined: Thu May 31, 2012 7:34 am

Postby negapo » Fri Jun 01, 2012 10:45 am

I'm not using BA so i don't know what signals a market being close but you can check for that:

Code: Select all
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Columns.Count <> 16 and Range("Q2").Value <> "Closed" Then Exit Sub
Application.EnableEvents = False

If Range("F36").Value = 2 Then
Range("Q2").Value = -1
Else: Range("Q2").Value = ""

Application.EnableEvents = True
End Sub


This is just an example, don't know the cell and the info on the cell to signal a market is close.
negapo
 
Posts: 179
Joined: Thu Mar 19, 2009 1:17 pm
Location: Porto, Portugal

Postby Captain Sensible » Fri Jun 01, 2012 1:12 pm

The market closed status is sent to F2 so I just check if that says Closed and move on if it is
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm


Return to Help

Who is online

Users browsing this forum: Google [Bot] and 54 guests

Sports betting software from Gruss Software


The strength of Gruss Software is that it’s been designed by one of you, a frustrated sports punter, and then developed by listening to dozens of like-minded enthusiasts.

Gruss is owned and run by brothers Gary and Mark Russell. Gary discovered Betfair in 2004 and soon realised that using bespoke software to place bets was much more efficient than merely placing them through the website.

Gary built his own software and then enhanced its features after trialling it through other Betfair users and reacting to their improvement ideas, something that still happens today.

He started making a small monthly charge so he could work on it full-time and then recruited Mark to help develop the products and Gruss Software was born.

We think it’s the best of its kind and so do a lot of our customers. But you can never stand still in this game and we’ll continue to improve the software if any more great ideas emerge.