Help with VB to run a macro

Please post any questions regarding the program here.

Moderator: 2020vision

Postby Mitch » Wed Apr 04, 2007 11:56 am

I've always struggled getting the Calculate event to work so due to lazyness I use the Change event.

I think Calculate will fire when a cell changes due to the result of a formula changing, which should be the case with the cell AA1 as suggested earlier. I'll have a play around with it if I get the chance but it looks like between you you will have it sussed before long anyway.
User avatar
Mitch
 
Posts: 365
Joined: Sat Nov 19, 2005 12:28 am
Location: Leicester

Postby allgreen » Wed Apr 04, 2007 1:28 pm

dermag, it was remiss of me not to mention this before but the reason I was wanting to use SUM(X5:X28) is that I am betting into the place market with this sheet so any matched bets only change the P/L for the individual horse, not every horse in the field.

I was sitting here wondering how getting the change from only the last cell was going to do the trick when it finally dawned on me the difference in display of P/L for the two markets. Doh... :oops: Nonetheless all ideas generated from this discussion will no doubt come in handy somewhere down the track.
allgreen
 
Posts: 98
Joined: Wed Mar 08, 2006 7:28 am
Location: Down Under

Postby dermag » Wed Apr 04, 2007 1:40 pm

Hi allgreen,

I see what you mean about the place market. I'll keep at it and I'm sure between the forum we can come up with something.

A question though, if you don't mind. Why do you prefer worsheet_calculate over worksheet_change ? You can have your problem solved by using the _change event rather than the _calculate event. Same end result, just a different way there.
dermag
 
Posts: 60
Joined: Sun Feb 18, 2007 3:35 pm

Postby allgreen » Wed Apr 04, 2007 2:46 pm

dermag, if I can get my desired result I don't really care which means I have to use to do it. I don't have a preference for one or the other it's just that my limited VBA knowledge was leading me in a particular direction. I think initially I had arrived at the conclusion that worksheet_selection.change was the way to go then when I found this wasn't the case I thought worksheet.change probably also wouldn't work - thinking selection.change was just a refinement of worksheet.change, which it apparently isn't.

I have bought myself a copy of VBA for dummies so hopefully can read this over Easter and gain some rudimentry knowledge of the subject.

If you can accomplish what I want to do using worksheet_change then that is fine by me.
allgreen
 
Posts: 98
Joined: Wed Mar 08, 2006 7:28 am
Location: Down Under

Postby dermag » Wed Apr 04, 2007 4:03 pm

edited due to what seems to be a replicated post by me
dermag
 
Posts: 60
Joined: Sun Feb 18, 2007 3:35 pm

Postby allgreen » Tue Apr 10, 2007 9:57 am

dermag, I rearranged my worksheets so I could use your code and tried it for the first time over the weekend and it worked perfectly. Thanks very much for your help.
allgreen
 
Posts: 98
Joined: Wed Mar 08, 2006 7:28 am
Location: Down Under

Postby dermag » Tue Apr 10, 2007 4:05 pm

Hi allgreen,

No problems. Glad you got it working.
dermag
 
Posts: 60
Joined: Sun Feb 18, 2007 3:35 pm

Previous

Return to Help

Who is online

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