Recording Price Movements in Excel

Discuss anything related to using the program (eg. triggered betting tactics)

Moderator: 2020vision

Recording Price Movements in Excel

Postby MartinP_uk » Sat Mar 13, 2010 9:39 am

I'm sure i have read/seen some code on here to record price movements. Could somebody please post a link as i cannot seem to find it. What i would like to do is record the price movements in F5.
User avatar
MartinP_uk
 
Posts: 41
Joined: Wed Nov 28, 2007 8:41 am

Postby MartinP_uk » Sun Mar 14, 2010 12:42 pm

Must of been on another forum :?
User avatar
MartinP_uk
 
Posts: 41
Joined: Wed Nov 28, 2007 8:41 am

Postby 2020vision » Sun Mar 14, 2010 1:32 pm

Hi MartinP_uk :)

would any of these posts be of use to you?

http://www.gruss-software.co.uk/forum/v ... ght=record
http://www.gruss-software.co.uk/forum/v ... ght=record
http://www.gruss-software.co.uk/forum/v ... ght=record
http://www.gruss-software.co.uk/forum/v ... ght=record

Can not say for sure if any of the downloads are still available but you could
ask their makers to upload again if not?

Ttfn - Michael :)
User avatar
2020vision
Moderator
 
Posts: 605
Joined: Sun Feb 17, 2008 10:24 pm
Location: Nottingham

Postby MartinP_uk » Sun Mar 14, 2010 10:03 pm

You must need 2020vision to find those threads 8)

Cheers m8 :wink:
User avatar
MartinP_uk
 
Posts: 41
Joined: Wed Nov 28, 2007 8:41 am

Postby MartinP_uk » Sun Mar 14, 2010 10:47 pm

I'm still having trouble with getting this to work. If somebody can knock up a sheet that records the price movements of all the horses i'd be happy to pay by paypal. Pls pm me.
User avatar
MartinP_uk
 
Posts: 41
Joined: Wed Nov 28, 2007 8:41 am

Postby MartinP_uk » Thu Mar 18, 2010 8:58 pm

I have managed to scrape together this piece of code that copies the contents of Y5:Y50 into the next column. How would it be possible to then past Y5:Y50 into the next available column every time Betting Assistant refreshes? i.e every 2 secs.

Code: Select all
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim NextCol As Long

If Target.Columns.Count <> 16 Then Exit Sub
NextCol = Cells(Target.Row, Columns.Count).End(xlToLeft).Column + 1
Application.EnableEvents = False
Range("Y5:Y50").Copy
Cells(5, NextCol).PasteSpecial Paste:=xlPasteValues

End Sub
User avatar
MartinP_uk
 
Posts: 41
Joined: Wed Nov 28, 2007 8:41 am

Postby MartinP_uk » Thu Mar 18, 2010 9:07 pm

Also could somebody please explain what the following means please
Code: Select all
 If Target.Columns.Count <> 16 Then Exit Sub
User avatar
MartinP_uk
 
Posts: 41
Joined: Wed Nov 28, 2007 8:41 am

Postby osknows » Thu Mar 18, 2010 10:03 pm

The code you have is placed in a worksheet change event i.e. - Private Sub Worksheet_Change(ByVal Target As Range)

So when the worksheet changes the event fires and the changed cells are picked up as a range object in 'Target'

BA updates excel with 2 different refreshes, one for prices and one for balance updates etc

For price updates 16 columns are updated; therefore 'If Target.Columns.Count <> 16 Then Exit Sub' essentially checks if BA has refreshed prices rather than you just changing the odd cell. If BA has refreshed then Target.Columns.Count =16 and the code below runs otherwise it exits the VBA Subroutine
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby osknows » Thu Mar 18, 2010 10:14 pm

MartinP_uk wrote:I have managed to scrape together this piece of code that copies the contents of Y5:Y50 into the next column. How would it be possible to then past Y5:Y50 into the next available column every time Betting Assistant refreshes? i.e every 2 secs.

Code: Select all
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim NextCol As Long

If Target.Columns.Count <> 16 Then Exit Sub
NextCol = Cells(Target.Row, Columns.Count).End(xlToLeft).Column + 1
Application.EnableEvents = False
Range("Y5:Y50").Copy
Cells(5, NextCol).PasteSpecial Paste:=xlPasteValues

End Sub



Your code works fine I think, the only problem is you have disabled events using 'Application.EnableEvents = False' and not enabled them again

try this

Code: Select all
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim NextCol As Long
Application.EnableEvents = False

NextCol = Cells(Target.Row, Columns.Count).End(xlToLeft).Column + 1

Range("Y5:Y50").Copy
Cells(5, NextCol).PasteSpecial Paste:=xlPasteValues
Application.EnableEvents = True
End Sub
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby MartinP_uk » Thu Mar 18, 2010 10:15 pm

thanks osknows that kinds makes sense :?
User avatar
MartinP_uk
 
Posts: 41
Joined: Wed Nov 28, 2007 8:41 am

Postby MartinP_uk » Thu Mar 18, 2010 10:20 pm

osknows wrote:
MartinP_uk wrote:I have managed to scrape together this piece of code that copies the contents of Y5:Y50 into the next column. How would it be possible to then past Y5:Y50 into the next available column every time Betting Assistant refreshes? i.e every 2 secs.

Code: Select all
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim NextCol As Long

If Target.Columns.Count <> 16 Then Exit Sub
NextCol = Cells(Target.Row, Columns.Count).End(xlToLeft).Column + 1
Application.EnableEvents = False
Range("Y5:Y50").Copy
Cells(5, NextCol).PasteSpecial Paste:=xlPasteValues

End Sub



Your code works fine I think, the only problem is you have disabled events using 'Application.EnableEvents = False' and not enabled them again

try this

Code: Select all
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim NextCol As Long
Application.EnableEvents = False

NextCol = Cells(Target.Row, Columns.Count).End(xlToLeft).Column + 1

Range("Y5:Y50").Copy
Cells(5, NextCol).PasteSpecial Paste:=xlPasteValues
Application.EnableEvents = True
End Sub


osknows thank you very much your code works perfectly. thank you :D
User avatar
MartinP_uk
 
Posts: 41
Joined: Wed Nov 28, 2007 8:41 am

Postby osknows » Thu Mar 18, 2010 10:22 pm

Sorry made a mistake in the last code.... :)

use this

Code: Select all
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim NextCol As Long

If Target.Columns.Count <> 16 Then Exit Sub
NextCol = Cells(Target.Row, Columns.Count).End(xlToLeft).Column + 1
Application.EnableEvents = False
Range("Y5:Y50").Copy
Cells(5, NextCol).PasteSpecial Paste:=xlPasteValues
Application.EnableEvents = True
End Sub
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am


Return to Discussion

Who is online

Users browsing this forum: No registered users and 40 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.