Quickpick list in Excel

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

Moderator: 2020vision

Quickpick list in Excel

Postby Shaun » Wed Nov 11, 2015 6:09 am

I have a macro setup to switch between races based on the list in excel, the issue i face is i need 2 different races, just having trouble getting the second race to activate, even tried 2 different macros linked, any thoughts.

Code: Select all

Sub Race1()
With ThisWorkbook
.Sheets("Data").Range("Q2").Value = .Sheets("Data_QuickPickList").Range("N1").Value
End With
Race2
End Sub
Sub Race2()
With ThisWorkbook
.Sheets("Data").Range("Q51").Value = .Sheets("Data_QuickPickList").Range("O1").Value
End With
End Sub


Am using a simple data validation list and vlookup to get the race ID
Shaun
 
Posts: 435
Joined: Fri May 09, 2008 11:11 pm
Location: Kellerberrin, Western Australia

Re: Quickpick list in Excel

Postby Captain Sensible » Wed Nov 11, 2015 12:26 pm

Any reason why you don't just use

Code: Select all
Sub Race1()
With ThisWorkbook
.Sheets("Data").Range("Q2").Value = .Sheets("Data_QuickPickList").Range("N1").Value
.Sheets("Data").Range("Q51").Value = .Sheets("Data_QuickPickList").Range("O1").Value
End With
End Sub


I've always used Call to run other macros have you tried

Code: Select all
Call Race2
instead of Race2 if you need Race2() to run separately at other times.
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: Quickpick list in Excel

Postby Shaun » Wed Nov 11, 2015 1:52 pm

That is what i originally had, what i was finding is that the second race was failing to change, think it had to do with the refreshes, right now i have 2 separate buttons but would love to run it from one macro.
Shaun
 
Posts: 435
Joined: Fri May 09, 2008 11:11 pm
Location: Kellerberrin, Western Australia

Re: Quickpick list in Excel

Postby Captain Sensible » Wed Nov 11, 2015 2:17 pm

What's it actually doing? Might be easier ways to acheive it.

If it's because it can't complete two actions within the same refresh just have Race1() set a flag to say Race(2) runs on the next refresh.



Sub Race1()
With ThisWorkbook
.Sheets("Data").Range("Q2").Value = .Sheets("Data_QuickPickList").Range("N1").Value
.Sheets("Data").Range("AA1").Value = "Run macro race 2"
End With
End Sub



Then within you main code, before the code that fires macro Race(1), something simple like

Code: Select all
If .Sheets("Data").Range("AA1").Value = "Run macro race 2" Then Call Race2()


Code: Select all
Sub Race2()
With ThisWorkbook
.Sheets("Data").Range("Q51").Value = .Sheets("Data_QuickPickList").Range("O1").Value
.Sheets("Data").Range("AA1").Value = ""    'Just to reset the flag
End With
End Sub
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: Quickpick list in Excel

Postby Shaun » Thu Nov 12, 2015 3:13 am

Thanks, setting up a flag did the trick
Shaun
 
Posts: 435
Joined: Fri May 09, 2008 11:11 pm
Location: Kellerberrin, Western Australia

Re: Quickpick list in Excel

Postby Lovefanluv » Thu Nov 26, 2015 11:35 am

The floor can be a source of feedback that you bring this issue out of the channel.
The data are interesting issues. Layers can study To learn next
Lovefanluv
 
Posts: 2
Joined: Thu Nov 26, 2015 10:56 am


Return to Discussion

Who is online

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