Macro Help

Please post any questions regarding the program here.

Moderator: 2020vision

Macro Help

Postby mak » Thu Jan 28, 2010 11:55 am

I have some routines in order to place -1 at Q2 every 3 minutes

Is there a way to place at q2 -1 first and -3.1

My code is the following

Sub TheSub()
''''''''''''''''''''''''
Cells(2, 17).Value = -1

''''''''''''''''''''''''
StartTimer ' Reschedule the procedure
End Sub

if I just place the Cells(2, 17).Value = -3.1 it only places the -3.1

Sub TheSub()
''''''''''''''''''''''''
Cells(2, 17).Value = -1
Cells(2, 17).Value = -3.1
''''''''''''''''''''''''
StartTimer ' Reschedule the procedure
End Sub

thanks in advance
mak
 
Posts: 1086
Joined: Tue Jun 30, 2009 8:17 am

Postby waynethebrayn » Thu Jan 28, 2010 2:01 pm

mak,

have you tried putting the values the other way round? i.e. refresh the list first and then use -1 to select the market.

or do the refresh once (perhaps manually) and then separately use VBA to just do the 3 minute -1 update.

I'm sure the experts here will have a better solution though.
waynethebrayn
 
Posts: 32
Joined: Fri Feb 23, 2007 6:21 pm
Location: Wales

Postby waynethebrayn » Thu Jan 28, 2010 2:03 pm

mak,

also the code will be running very quickly so -1 may be added but is replaced by -3.1 faster than you can observe.
waynethebrayn
 
Posts: 32
Joined: Fri Feb 23, 2007 6:21 pm
Location: Wales

Postby mak » Thu Jan 28, 2010 2:35 pm

I will try the -3.12 first but I am almost certain that it won't work.
Because right know it it is not gonig to next market at all.
mak
 
Posts: 1086
Joined: Tue Jun 30, 2009 8:17 am

Postby osknows » Thu Jan 28, 2010 4:40 pm

I'm on a train without excel so haven't tested this but how about something along the lines of

Public timer_triggered as boolean

'===================

Sub TheSub()
''''''''''''''''''''''''
Cells(2, 17).Value = -1
timer_triggered = true
''''''''''''''''''''''''
StartTimer ' Reschedule the procedure
End Sub

'=======================

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False


if timer_triggered = true then
ThisWorkbook.Sheets(Target.Worksheet.Name).Cells(2, 17).Value = - 3.1
timer_triggered = false
end if

Application.EnableEvents = true
end sub
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby mak » Thu Jan 28, 2010 5:15 pm

Os hi
hope you are fine.
Thanks for your code it is working fine!
mak
 
Posts: 1086
Joined: Tue Jun 30, 2009 8:17 am


Return to Help

Who is online

Users browsing this forum: Google [Bot] and 27 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.