That's a very good implementation of the game - nice job!
The only minor complaint I have is that the score disappears as soon as the game is finished, it would be nicer if it stayed (but perhaps in a different colour) until a new game is started.
In terms of the code there are a few bits that can be shortened/simplified, one of which is the repetition of code in Clicked. The code for rows 3,4,5 are identical, so rather than have a Case for each one you could use a single case for all three, eg:
alternative syntax using a range:Code:Case 5, 4, 3 'Bottom/second/third row of layout
As most of the code is also identical for row 2, you could even merge them all, like this:Code:Case 3 to 5 'Third/second/bottom row of layout
Code:Case 2 To 5 'layout CellRef = Xlate(Target.Column, Target.Row) ... Range(CellRef).Interior.ColorIndex = 10 If Target.Row = 2 Then 'Top row of layout Finished = Finished + 1 If Finished = 3 Then 'All 3 cards at the top of the peaks used Score = Score + (Unused - 11) 'Bonus based on no of cards unused [A3] = Score [K7] = "" Range("K7").Interior.ColorIndex = 10 cmdShuffle_Click End If Else 'other rows CheckOpening (CellRef) End If End If End If
Most of the routines in Module11 aren't really needed, as there are already equivalents built in (which should be faster than yours), eg:
ToUpper: UCase
ToLower: LCase
StringSearch: InStr
Replace: Replace (but slightly different behaviour to your version, so probably not apt).
FindNumber and FindLetter can be simplified slightly by replacing this:
with this:Code:Asc(Mid(Ref, f, 1)) <= 57 And Asc(Mid(Ref, f, 1)) >= 48
Code:IsNumeric(Mid(Ref, f, 1))




Reply With Quote