Out of my depth but here goes

Discussion regarding the spreadsheet functionality of Bet Angel.
Post Reply
goldfinch77
Posts: 244
Joined: Wed Aug 05, 2020 11:45 am

This is really a request for help with VBA and the spreadsheet.

I am trying to learn VBA, so I thought I would set myself a simple task ( so he thought :roll: )
The idea was if I could get the idea to work, I could "reverse engineer" the code and see what does what.

I really did not know where to start so I wrote the task down and copied to AI, what a great Idea that was, so for a month we have been going round and round every day for hours with more and more debugging than I could handle so Here I am
If anyone can help , I will let santa know, this is what I put into AI..

Notes.
The Excel version I am using is 2007.

My knowledge of VBA is very limited, this is a project to learn more

The source workbook is “Bet Angel” This is a pre populated template, many cells are read only, others can be used.

The target, is sheet 2 of this workbook.

Source Cell (SC) G1 is used to start the monitoring. It is blank to start with, but the monitoring below will start by typing “In-play” ( this is when, in auto, the race starts)

SC cells G9, G11, G13, G15 and K9, L11, K13, K15 are the cells to be monitored for a value of 1.01

Only one can be used (even if both are set, it is the first one to trigger) this will determine which of the 4 horses won the race, this would typically be the end of the race.

When this occurs, I would like the monitoring to stop, send the Excel row number that had the value 1.01 into the Target Sheet (TA) cell E6, Along with the race name (held in SC B1) to TA cell K6,

If no 1.01 is found then put an X in SC E6 and the race name in K6,

Once this has been done I will clear SC cells manually, on the next race the same procedure is to be carried out except the SC row number to move down 1 ie E7 and K7 and so on for each new race.

Initially this will be tested in manual mode.

I will also need the following, Start and Stop subs in the macro box, so i can create buttons at a later date.
So I can see what is happening, place the macro status, i.e. running or stopped in SC J1.
User avatar
conduirez
Posts: 481
Joined: Tue May 23, 2023 8:25 pm

goldfinch77 wrote:
Thu Nov 21, 2024 5:36 pm
This is really a request for help with VBA and the spreadsheet.

I am trying to learn VBA, so I thought I would set myself a simple task ( so he thought :roll: )
The idea was if I could get the idea to work, I could "reverse engineer" the code and see what does what.

I really did not know where to start so I wrote the task down and copied to AI, what a great Idea that was, so for a month we have been going round and round every day for hours with more and more debugging than I could handle so Here I am
If anyone can help , I will let santa know, this is what I put into AI..

Notes.
The Excel version I am using is 2007.

My knowledge of VBA is very limited, this is a project to learn more

The source workbook is “Bet Angel” This is a pre populated template, many cells are read only, others can be used.

The target, is sheet 2 of this workbook.

Source Cell (SC) G1 is used to start the monitoring. It is blank to start with, but the monitoring below will start by typing “In-play” ( this is when, in auto, the race starts)

SC cells G9, G11, G13, G15 and K9, L11, K13, K15 are the cells to be monitored for a value of 1.01

Only one can be used (even if both are set, it is the first one to trigger) this will determine which of the 4 horses won the race, this would typically be the end of the race.

When this occurs, I would like the monitoring to stop, send the Excel row number that had the value 1.01 into the Target Sheet (TA) cell E6, Along with the race name (held in SC B1) to TA cell K6,

If no 1.01 is found then put an X in SC E6 and the race name in K6,

Once this has been done I will clear SC cells manually, on the next race the same procedure is to be carried out except the SC row number to move down 1 ie E7 and K7 and so on for each new race.

Initially this will be tested in manual mode.

I will also need the following, Start and Stop subs in the macro box, so i can create buttons at a later date.
So I can see what is happening, place the macro status, i.e. running or stopped in SC J1.
I realise that you may not want to pay out too much whilst learning, but if you really want to press on I would advise you to subscribe to Microsoft 365 it is £5.99 for a single home machine a month and £7,99 for I believe five devices per month. You can cancel anytime you want. In the package is the latest version of Excel. You will find much more functionality and you will find that a lot of material you will learn does not work so well or at all on pre 2016 Excel packages.

You may find you can get a free months trial with Microsoft 365 and you can cancel whenever you want.

I can't quite understand what you are trying to do as I have seen 1.01 in running and that selection gets beaten.

To your question about Macros, I would not want a Macro running constantly, so I would tend to have a mixture of cell functions and Macros that constantly monitor and run only if a condition is met. I would only run a Macro to write to the Bet Angel Worksheet and not have a Macro running directly from the Bet Angel worksheet, unless it is from a button.

Open a new Worksheet and call it something like 'Control' add in the Control worksheet cell formulas or copy cells, from the Bet Angel Worksheet. ie in cell A2 of the Control Worksheet put in the formula '='Bet Angel'!G11'

Once you have worked that out you can add code to the Control Worksheet Window. Watch the Youtube clip, it gives you more ideas, Good Luck.

https://www.youtube.com/watch?v=RPcYeBeeuD0
User avatar
Derek27
Posts: 25157
Joined: Wed Aug 30, 2017 11:44 am

It would be really difficult to reverse engineer code will little understanding of the language. You'd be far better off taking the time to learn VBA from scratch from one of the many free online guides. At least learn the basics. What you are trying to do isn't very advanced.
Anbell
Posts: 2364
Joined: Fri Apr 05, 2019 2:31 am

GPT is probably very helpful too
goldfinch77
Posts: 244
Joined: Wed Aug 05, 2020 11:45 am

Thanks to all who took the time to reply.

Believe it or not, it was because GPT was going round in circles I came here.

The reverse idea was if I knew something was working I would have looked at the code and tried to use a section of it in another spreadsheet.

The reason for all this is, for horse race data gathering.
I have a Guardian strat that has several conditions that I built in, however, during testing I found some work and some didn't, so i created my own template for "Bet Angel" Sheet2 with all the controls coded in (just in excel)
I built another Guardian strat, this time to record the top 4 horse prices as stored values and using the Excel function sent them to my template, the idea was to record the winner of each race and at the end of the day play with contols and see if there was anything that came up enough time to use.

So Iwill look a the suggestions here and see if cann see the light

Goldfinch
User avatar
Dabbla
Posts: 823
Joined: Wed Apr 15, 2009 1:50 pm

Are you aware that BA can create Excel sheets via the (Export all stored values) rule in automation?
You don’t need to have Excel opened constantly to save data.
You can have one rule that stores Winner after Winner. Then another rule that creates a new excel sheet for every races. That’s done by changing the (Filename options) to (append the market name ).
You can trigger the rule every refresh, that way you can get the full market data.
If you don’t append, then BA will update the same sheet, that’s how you would have Winner after Winner in the same sheet.

The other options I go for are
Values to export > Only stored values marked as shared (exclude history lists).
Export file format > single row
Depending what you want to store, (tick) > limit export to a specific stored values and add the SVs you wish.
tico
Posts: 49
Joined: Fri Sep 20, 2024 9:18 pm

Hi,
Just a thought but it's worth trying Perplexity and DeepSeek AI models ,both are red hot on VBA and both are Free Good Luck and Kind regards
Tico
Post Reply

Return to “Bet Angel - Spreadsheet / Excel chat”