Auto clearing status cells

Example spreadsheets and comments on example spreadsheets.
Wyndon
Posts: 237
Joined: Sun Nov 13, 2011 10:14 am

I think I've cracked it! Just waiting for racing to start. This repeated update facility is phenemonally useful.
User avatar
TheTub
Posts: 267
Joined: Thu Mar 26, 2009 7:53 pm
Location: Nottinghamshire

How did you crack it?

I would use practice mode to start with. Auto-clearing status cells can result in hundreds of bets being placed in a very short space of time if you are not careful.
Wyndon
Posts: 237
Joined: Sun Nov 13, 2011 10:14 am

I spoke to soon! All sorts of problems appeared on a live test. I'd hoped to embed my own sub-routine into the periodic update macro - but it failed dismally. However, I reproduced a Calculate worksheet that I found on another search of the forum, which did the trick of automatically clearing the status cells once the market has been suspended. Testing went OK yesterday evening.
User avatar
EyePeaSea
Posts: 258
Joined: Sun Jun 12, 2011 11:18 am

TheTub wrote:How did you crack it?

I would use practice mode to start with. Auto-clearing status cells can result in hundreds of bets being placed in a very short space of time if you are not careful.
Whilst I'm still running a system in 'beta' mode (real money, but small stakes), I'm happy to deliberately not clear cells. BetAngel's refusal to let me stake twice if I don't clear the cells has saved me a few times :oops:
alto
Posts: 3
Joined: Fri Jul 19, 2013 11:18 am

Hi.
I've got the spreadsheet working (IE, it clears the cells when I click the Start button) but it doesn't continue to clear every 10 seconds thereafter.

Is this what it is supposed to do? Am I getting something wrong?
I'm having the same issue.
Anyone have come up with an solution?

Thanks
bamthwok
Posts: 10
Joined: Thu Apr 30, 2009 7:14 pm
Location: Manila/ Philippines

Hi,

Can someone please help and advise how to make this idea work for the Betangel multiple spreadsheet.

Any advise is highly appreciated.

Cheers,
bamthwok
tony63
Posts: 22
Joined: Wed Mar 16, 2016 12:14 pm

Hello.

I downloaded the spreadsheet that auto clears the cells yesterday and was planning to trial it today.

I know you are aware of this but is has probably slipped your mind, I am one of, I suspect, many people that are not able to sit and watch the markets but HAVE to rely on automation.

As soon as I open an unrelated worksheet I get "subscript out of range". When I go into the debugger the problem is

Worksheets("Sheet2").Range("a4") = 1

I can muddle my way through visual basic but I don't know enough to correct it. It appears that the routine is applying to the whole of Excel rather that the specific workbook.

Thanks.
tony63
Posts: 22
Joined: Wed Mar 16, 2016 12:14 pm

Sorry - Should have said. I'm working on the latest version of Excel.
nigelk
Posts: 469
Joined: Wed Apr 15, 2009 11:00 pm

If you have 2 or more workbooks open vba gets a bit confused as to which workbook you are referring to.

It's likely that the code refers only to its own workbook, which hasn't got a sheet named "Sheet2".

You'll need to fully qualify each reference to each workbook.

If I have 1 workbook open, Twb and Owb will give the same result. If I have 2 workbooks open, and the 2nd is the ACTIVE (the one you are looking at), Owb will return a different name.

Code: Select all

Sub test()


Dim Twb As Workbook, Owb As Workbook

Set Twb = ThisWorkbook
Set Owb = ActiveWorkbook

MsgBox Owb.Name


End Sub
This can refer to either workbook, (but will fail if it can't find a sheet named sheet1.)

Code: Select all

Owb.Sheets("Sheet1").Range("A2") = "1"
This will always refer to the workbook in which the code resides.(Again will fail if no sheet named sheet1).

Code: Select all

Twb.Sheets("Sheet1").Range("A2") = "1"
andrewcichello
Posts: 6
Joined: Tue Nov 22, 2016 10:15 am

Hi Everyone,

The attached file works for me however I'd like to use this with multiple sheets. Does anyone have a worksheet clearing status cells on multiple sheets? Or a work around? I want to bet on many races per day and clear the status cells every 60 seconds.

Any help would be greatly appreciated.

Cheers,

Andrew
You do not have the required permissions to view the files attached to this post.
nigelk
Posts: 469
Joined: Wed Apr 15, 2009 11:00 pm

This will clear all status cells on any sheets beginning with the name "Bet Angel"

Note that since there are multiple sheets the formula in J2 in not relevant as it only points to 1 sheet.

Edit. Posted wrong sheet. Below is correct.
You do not have the required permissions to view the files attached to this post.
User avatar
workpeter
Posts: 165
Joined: Sat Jul 30, 2016 8:29 pm

We all have specific requirements for when we want to clear status. So rather than wait for others to give you a part solution build something yourself. Write conditional statments based on spreadsheet data within a worksheet_calculate event. This allows you to trigger a cleardown when you define. This built in function is called whenever a formula calculation is triggered. So in a single cell have a formula which sums up the countdown,odds and unmatched money. This will ensure continous streaming of triggers on any key change anywhere from miliseconds to a second.

Secondly, to avoid unwanted bets when clearing status, also clear down one of the other fields i.e. stake or bet command.

Thirdly, for multi-spreadSheet always uss me.cells commands rather than sheet1.cells (sheet2..3..4..5 etc). This allows you to copy/replicate the sheet with the code and it will.work in each specific sheet.
Callumbet97
Posts: 2
Joined: Wed Apr 12, 2017 11:06 am

alto wrote:
Sun Jul 21, 2013 8:26 pm
Hi.
I've got the spreadsheet working (IE, it clears the cells when I click the Start button) but it doesn't continue to clear every 10 seconds thereafter.

Is this what it is supposed to do? Am I getting something wrong?
I'm having the same issue.
Anyone have come up with an solution?

Thanks
Also having the same issue. Any solution?
nigelk
Posts: 469
Joined: Wed Apr 15, 2009 11:00 pm

In H4 the countdown timer is converted into seconds.

In I4 the mod function divides by ten for your 10 second timer.

J4 will increase by 1 each time when the divisor is zero.

Note: A 1/2 second delay (sleep 500) has been added to stop the routine sometimes firing twice. Depending to the complexity of your code and how long it takes to run, I would imagine that this could be removed if required, but haven't tried it.

Replace the "Range("j4") = Range("j4") + 1" code with your clear status subroutine

Cheers,Nigel.
BetAngel_10 seconds.7z
You do not have the required permissions to view the files attached to this post.
CallumPerry
Posts: 575
Joined: Wed Apr 19, 2017 5:12 pm
Location: Wolverhampton

Good evening gents,

I thought I'd ask the question in this thread to keep everything tidy and relevant. Would anybody be kind enough to spare a code for clearing the status cell, instead of going be a timer has anybody done it using the worksheet_change function using VBA?

My strategy will require quite quickly clearing cells you see. Because of this though, I have another problem. If for example I put the following in cells L9, M9 and N9:
BACK, 4.0, 2

But then my formula changes L9 from BACK to " " before the bet has had chance to be placed, I get left with 'OK' or even just 'ERROR'. Is there a way, again using VBA (perhaps intertwined with the clear status worksheet_change function) that I can have a spreadsheet keep the order in the instruction field long enough for it to go through?

Extra info:
BACK Triggers - D31:D36 (For 6 seperate runners)
LAY Trigger - E31:E36 (Ditto)
BACK CLOSE Trigger - F31:F36 (And again)
LAY CLOSE Trigger - G31:G36 (You guessed it!)

So to reiterate, Cell D31 says "BACK" for horse 1 but can change quickly (before the order hits the market) and then after it's been placed, I'd like to immediately clear the status cell please. I have precautions in place with the triggers to avoid multiple bets firing in already. If anybody could be so kind as to share some code or point me in the right direction it would massively help me out.

Cheers lads!
Callum :)
Post Reply

Return to “Bet Angel - Example spreadsheets”