Robert,
I just took a look at the code behind my "AddTicket" procedure to see
exactly how I handled ticket numbering. Turns out my code inserts a
formula as follows...
=TicketNumber
...which took me to the Define Name dialog to see how this was
constructed. Turns out this uses row position relative to the header
row above where the first draw record starts. Draw win nums are listed
on the left side of the wks. Ticket nums/combos are listed to the right
of the draw history cols. Analysis/Wheeling section is to the right of
tickets list.
The RefersTo for the defined name formula "TicketNumber" is...
="Ticket #"&(ROW()-ROW('649'!TicketsToCheck_Hdr))
...where "TicketsToCheck_Hdr is located in Rows(6), and so tickets start
listing in Rows(7). So the above formula simply subtracts 6 from
whatever row the formula is in and concatenates the result to the text
shown. I'm sure I did this so I could re-order ticket combos if
generating 'Quick Picks' instead (or along with) wheeled combos using a
preferred list of nums akin to 'hot' or 'fav#' as determined by
criteria in the analysis area.
This RefersTo refs the locally scoped defined name range on
Sheets("649"). Sheets("749") also contains a range with the same
locally scoped defined name, as would any other sheet for any other
draw. Since our national scope draws are only 2 in count (649 <6/49 &
LottoMax <7/49), these are the only lottery games I'm tracking.
There's no reason, though, why a Sheets("539") can't be added to the
wkb. I haven't included any 5/39 or 6/39 wheels but I know tonnes of
them exist out there in cyberspace. Each sheet contains a DV dropdown
in the Wheeling section so I can choose which wheel config to use for
generating ticket combos. The list only contains those wheel configs
that apply to the lottery game for that sheet. The wheel algorithms are
stored on a hidden sheet in horizontal ranges, and are grouped
according to the game they apply to (ie: 649, 749). For example, wheel
config '12Numbers 42Tickets 5/6Odds' will be used to generate 42
tickets using 12 specified numers that could yield 5/6 odds if all nums
drawn are in the 12 nums specified. The specified list can be
prioritized for concentration purposes since these wheel algorithms are
'abbreviated', meaning they don't generate every possible num combo.
--
I'm not sure I follow when you state...
"If the user enters a string of "1 2 3 5 10", how can you calculate
that this combo might occur at position #24 in the combo list (without
using an array)? How might you be able to calculate that combo "1 2 3
4 5" occurs at position #1??"
...which suggests that each combo may have some criteria that determines
where it 'belongs' in the list. 'Next ticket#' is my approach.
Does this help?
--
Garry
Free usenet access at
http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc