Macro help (Yep, another one!!!)

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

Moderator: 2020vision

Postby thunderfoot » Tue May 01, 2007 7:26 pm

I don't have BA connected to EXCEL, and all I'm doing is adding a letter to the end of the event details in cell A1. all the cells in range B5:G10 show 0 (zero), F2 shows 'Suspended' and as cell A1 does not equal cell A24 (because I'm adding a letter to the end) I would expect it to trigger my Copy/Paste/Sort routine. I've tried it with the code If Target.Columns.Count <> 16 Then Exit Sub and done as Mitch suggested (I highlighted cells A11:P11 and pressed 'Delete'), and I also tried it with the code editted out, and I still can't get the code to trigger the Copy/Paste/Sort routine. :? :?
User avatar
thunderfoot
 
Posts: 270
Joined: Sat Nov 19, 2005 2:52 pm
Location: West Country

Postby GeorgeUK » Tue May 01, 2007 7:39 pm

What values do you get when you step through the code?

try this:
On the line {If Target.Columns.Count <> 16 Then Exit Sub} selct it and press F9 (turning it brown)
go back to the worksheet and do Mitch's suggestion of selecting the 16 columns and pressing delete.
(the worksheet change macro should fire and bring up the vba at the break line).
Put your cursor over target.columns.count
(this should read 16 as you have done the delete on 16 columns)
press F8 to go through the rest of the lines to ensure they are not coming up as false and ending the sub.

how do you get on with this?
previously known as Gaseous (on the betfair forum)
User avatar
GeorgeUK
 
Posts: 315
Joined: Sat Nov 19, 2005 10:18 pm
Location: Scotland

Postby thunderfoot » Tue May 01, 2007 11:15 pm

GeorgeUK wrote:What values do you get when you step through the code?

try this:
On the line {If Target.Columns.Count <> 16 Then Exit Sub} selct it and press F9 (turning it brown)
go back to the worksheet and do Mitch's suggestion of selecting the 16 columns and pressing delete.
(the worksheet change macro should fire and bring up the vba at the break line).
Put your cursor over target.columns.count
(this should read 16 as you have done the delete on 16 columns)
press F8 to go through the rest of the lines to ensure they are not coming up as false and ending the sub.

how do you get on with this?


Hi G,
Yep, it does read 16. Pressing F8 jumps from
Code: Select all
If Range("F5") = "Suspended" Then
to the last 'End If' statement. :? :?
F5 = "Suspended";B5:G10 = 0 and A1<>A24, so I would have expected the code to go to
Code: Select all
If WorksheetFunction.Sum(Range("B5:G10")) = 0 Then
and
Code: Select all
If Range("A1") <> Range("A24") Then
User avatar
thunderfoot
 
Posts: 270
Joined: Sat Nov 19, 2005 2:52 pm
Location: West Country

Postby GeorgeUK » Tue May 01, 2007 11:32 pm

What if you try defining it as text?

aa = Range("F5").text
If Range("F5").text = "Suspended" then

If you put this, then you should be able to see what the code is saying F5 is from hovering over aa
See if this helps, and also check there isn't a spelling mistake or extra space in the cell
previously known as Gaseous (on the betfair forum)
User avatar
GeorgeUK
 
Posts: 315
Joined: Sat Nov 19, 2005 10:18 pm
Location: Scotland

Postby thunderfoot » Wed May 02, 2007 10:53 am

GeorgeUK wrote:What if you try defining it as text?

aa = Range("F5").text
If Range("F5").text = "Suspended" then

If you put this, then you should be able to see what the code is saying F5 is from hovering over aa
See if this helps, and also check there isn't a spelling mistake or extra space in the cell


aa="0.00". F5 definitely reads Suspended.

Pressing F8 does as above, goes to
Code: Select all
If Range("F5").Text = "Suspended" Then
then jumps to the last 'End If' statement!!! :? :? :cry: :cry:
User avatar
thunderfoot
 
Posts: 270
Joined: Sat Nov 19, 2005 2:52 pm
Location: West Country

Postby thunderfoot » Wed May 02, 2007 11:02 am

PRATT!!!!! It's not F5 it's F2 in'it!!! :oops:


Anyway, I still can't get it to work :?

In cell C20 I have the formula =IF(AND(SUM(B5:G16)=0,F2="Suspended",A24<>A1),1,0) to check the 3 scenarios I want to be TRUE so that this macro could be triggered. Could this formula be used as an alternative method of triggering the macro?
User avatar
thunderfoot
 
Posts: 270
Joined: Sat Nov 19, 2005 2:52 pm
Location: West Country

Postby Ian » Wed May 02, 2007 11:05 am

What cell is the start cell for data from BA ? Is it B4 ? "Suspended" would be in E2 if you start in A1.
Ian
 
Posts: 834
Joined: Sat Nov 19, 2005 8:35 am
Location: Birmingham

Postby Ian » Wed May 02, 2007 11:06 am

OK, B1 then ? :D
Ian
 
Posts: 834
Joined: Sat Nov 19, 2005 8:35 am
Location: Birmingham

Postby Ian » Wed May 02, 2007 11:11 am

I'm looking at an sheet which says in E2 "Not In Play" .. is it this cell that gets changed to "Suspended" ? You could be right about F2.
Ian
 
Posts: 834
Joined: Sat Nov 19, 2005 8:35 am
Location: Birmingham

Postby Ian » Wed May 02, 2007 11:18 am

There's a worksheet_calculate event which is triggered after a calculation so you may be able to just change the event to calculate.
Ian
 
Posts: 834
Joined: Sat Nov 19, 2005 8:35 am
Location: Birmingham

Postby thunderfoot » Wed May 02, 2007 11:55 am

GeorgeUK wrote:What if you try defining it as text?

aa = Range("F5").text
If Range("F5").text = "Suspended" then

If you put this, then you should be able to see what the code is saying F5 is from hovering over aa
See if this helps, and also check there isn't a spelling mistake or extra space in the cell


Re-booted computer; re-loaded EXCEL; re-loaded Workbook .....
NOW get :
Target.Columns.Count=16 when I hover over the appropriate code.
F8 steps through the code and hovering the mouse over "aa = Range("F2").Text" shows aa=Empty
F8 .... "If Range("F2").Text = "Suspended" Then" shows Range("F2").Text = "Suspended"
F8 .... steps through to "If WorksheetFunction.Sum(Range("B5:G10")) = 0 Then" (mouse hover shows nothing)
F8 ... "If Range("A1") <> Range("A24") Then" (mouse hover shows the value in cell A1)
etc.
etc.
etc.
.... and it worked!!!!!
User avatar
thunderfoot
 
Posts: 270
Joined: Sat Nov 19, 2005 2:52 pm
Location: West Country

Postby thunderfoot » Wed May 02, 2007 12:00 pm

Ian wrote:What cell is the start cell for data from BA ? Is it B4 ? "Suspended" would be in E2 if you start in A1.


Hiya .... shoulda said .... using the non API version to test the macro, so 'Trigger', 'Odds' and 'Stake' are in columns N, O & P not Q, R & S.
User avatar
thunderfoot
 
Posts: 270
Joined: Sat Nov 19, 2005 2:52 pm
Location: West Country

Postby thunderfoot » Wed May 02, 2007 12:08 pm

Thanks all,

Seems to be working fine now.

Manually changing A1 by adding a letter to the end; highlighting cells A17:P17; pressing delete, and whalla!! it copies/pastes/sorts. :D :D ..... and I can't even see-its-lips-move when it does it :D :D :D

If we had the Dancing Cow / Dancing Banana emoticons I'd be using it!!!!!!!
User avatar
thunderfoot
 
Posts: 270
Joined: Sat Nov 19, 2005 2:52 pm
Location: West Country

Postby thunderfoot » Wed May 02, 2007 1:38 pm

thunderfoot wrote:Hiya .... shoulda said .... using the non API version to test the macro, so 'Trigger', 'Odds' and 'Stake' are in columns N, O & P not Q, R & S.


....... and off course, as I'm testing on the 'Trader' version
Code: Select all
   If Target.Columns.Count <> 16 Then Exit Sub
should read
Code: Select all
   If Target.Columns.Count <> 13 Then Exit Sub
User avatar
thunderfoot
 
Posts: 270
Joined: Sat Nov 19, 2005 2:52 pm
Location: West Country

Postby tkp » Wed May 02, 2007 6:09 pm

This truely must be one of the crazyiest forums on the net.....anyone new coming in and reading some of these dicussions .....the mind boggles as to what they must think. :P
tkp
User avatar
tkp
 
Posts: 213
Joined: Fri Nov 18, 2005 8:41 pm
Location: Midlands

Previous

Return to Discussion

Who is online

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