Trigger VBA macros when BetFairs data feed in Excel changes or certain value?

Discussion regarding the spreadsheet functionality of Bet Angel.
Post Reply
Ourkid123uk
Posts: 22
Joined: Sun Feb 21, 2016 4:18 pm

Hi,

I have 2 Macros that need to be triggered only once when certain cell values from the BetFairs data feed are met.

1)

When Cell B1 changes value i need my macro "clearcellsready" to be triggered once.

2)

When Cell F4 is equal to "00:00:05" i need my macro "PASTE_VALUES" to be triggered once.



I'm REALLY scratching my head with this one guys! Its because the data that is been fed into my Work Book is from a feed, not entered manually and as such my macros wont trigger automatically.

I have got them working manually so that if i change the Cell Value in cell B1 and press enter this triggers "clearcellsready" and same with the other macro triggering when hit enter after inputting "00:00:05" into Cell F4.

I have tried many methods including running VBA that presses enter every second on these cells in the hope to trigger my macros when they meet my conditions.
I have also tried running "Sheet" Subs that constantly check for change in the these cells. As well as many other ideas including my computers clock to update these cells every second and then using the "Send" key "Enter" to replicate manually pressing enter and triggering these Macros.




Any help appreciated guy!
nigelk
Posts: 469
Joined: Wed Apr 15, 2009 11:00 pm

Your code needs to go in the sheet as a change event. When B1 changes in value, call your "clearcellsready" macro

Right click on the sheet tab and "view code"
You do not have the required permissions to view the files attached to this post.
Ourkid123uk
Posts: 22
Joined: Sun Feb 21, 2016 4:18 pm

Thanks for the swift reply nigel!

I have tried this and i cant seem to get it to work. Maybe i have a setting wrong?

I have attached a copy of my workbook, the 2 criteria i need to trigger my VBA macros are;

1) If Cell B1 changes value (as in next race) then run macro "clearcellsready"

2) When Cell F4 (Countdown Timer) is equal to "00:00:05" then run macro "PASTE_VALUES"

How do i use your suggested code to get this to work?

Many thanks for your help Nigel! Really appreciate it!
You do not have the required permissions to view the files attached to this post.
Ourkid123uk
Posts: 22
Joined: Sun Feb 21, 2016 4:18 pm

That seems to work for Cell B1's value changes now! Thank you!

How can i add the second part of - if the CountDown Timer in Cell F4 ="00:00:05" then run Macro "PASTE_VALUES"?

Can i add this to the same Sub in the 'Bet Angel' Sheet and how do i achieve this?

Really appreciate this Nigel!
nigelk
Posts: 469
Joined: Wed Apr 15, 2009 11:00 pm

Put a second countdown timer in H4 and added an event in the worksheet calculate section, it fires if H4=5, change to suit.
You do not have the required permissions to view the files attached to this post.
Ourkid123uk
Posts: 22
Joined: Sun Feb 21, 2016 4:18 pm

Nigel thank you SO bloody much!

I've been working with this and similar for nearly a week now constantly. Used lots of Excel forums and nothing...

It took you 2 mins. I always knew it was simple for someone with experience.

Thanks again :)
Tyhona02
Posts: 1
Joined: Tue Mar 13, 2018 7:02 pm

nigelk wrote:
Wed Feb 28, 2018 5:11 pm
Your code needs to go in the sheet Regroupement de prêt as a change event. When B1 changes in value, call your "clearcellsready" macro

Right click on the sheet tab and "view code"
Thank you for your help
Post Reply

Return to “Bet Angel - Spreadsheet / Excel chat”