vba global variables

Please post any questions regarding the program here.

Moderator: 2020vision

vba global variables

Postby dgs2001 » Mon Apr 09, 2007 7:59 pm

Help please.

This i'm sure will be a simple one for somebody :D

Where do I define a variable in my code so that it is available for other sheets within the same workbook?
I have a Workbook Open () sub which assigns the next empty row on my bet recording sheet to variable blr however when I try to refer to blr
in a different sheet module I get
Run Time Error 1004
Application-defined or Object-defined error :?

Thanks Duncan

[/u]
User avatar
dgs2001
 
Posts: 334
Joined: Thu Apr 05, 2007 4:53 pm
Location: The Home Of National Hunt

Postby GeorgeUK » Mon Apr 09, 2007 8:40 pm

I think i understand...

Code: Select all
public blr as string

sub workbook_open()
blr = now()
end sub

any other macro that refers to blr should then have the value that was inserted when the code read the "now" line.
previously known as Gaseous (on the betfair forum)
User avatar
GeorgeUK
 
Posts: 315
Joined: Sat Nov 19, 2005 10:18 pm
Location: Scotland

Postby dgs2001 » Tue Apr 10, 2007 12:59 am

Thanks George

I'm currently experiencing approx 50 'Urekka' moments a day !!!!

Your help is appreciated
User avatar
dgs2001
 
Posts: 334
Joined: Thu Apr 05, 2007 4:53 pm
Location: The Home Of National Hunt

Postby GeorgeUK » Tue Apr 10, 2007 9:05 am

Just let me know when you get a U-beauty moment :wink:
previously known as Gaseous (on the betfair forum)
User avatar
GeorgeUK
 
Posts: 315
Joined: Sat Nov 19, 2005 10:18 pm
Location: Scotland


Return to Help

Who is online

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