I present my very first Excel game (built mostly by me, but with some useful VBA provided by Colo
and also Juan Pablo Gonzalez
Play and enjoy! If you have any feedback, please leave a comment or email me at the link provided below. Thanks.
Download it here!
Posted by andrewe at 09:57
Thanks for both the compliments and the tip!
I was afraid of font problems (I have Excel in English but Office in Japanese). Anyway, I wasn't too sure about Sans Serif as my version is possibly different again, so I changed over to Arial. Figured that should be pretty safe.
Thanks very much once again!
Nice one. Pretty hard though!
As for other feedback - the only thing I found was that my PC wouldn't recognise the font you used for the instructions, and the formatting went a bit whacko. I unprotected the sheet and changed the font to MS Sans Serif - seemed to fix up the problem. I suspect this is a regional difference though, which may be difficult to get around.
Andrew, Arial font is available on English PC. I'd had same question but now I have English version OS, so I'll let you know the font list that can be used on English machine.
Much appreciated! Please let me know when you get the chance! Thanks!
If you want to remove the Analysis Toolpak reference, you could use
This is indeed an honor! Thank you for the alternative formula. The game has been updated already!
Here is an amusing way to pick 4 DIFFERENT random numbers from 1 to 6.
Private Sub CommandButton1_Click()
' find 4 different random numbers between 1 and 6 and display them in A1:An
Dim z As String
Dim i As Byte
Dim r As Byte
z = "123456"
For i = 1 To 4
r = Int((7 - i) * Rnd + 1) ' random number between 1 and (7-i), i.e. 1-6, 1-5, 1-4, and 1-3
Worksheets("Sheet1").Cells(1, i).Value = Mid(z, r, 1) ' use the rth character in z as the ith number
z = Mid(z, 1, r - 1) + Mid(z, r + 1) ' remove from z the rth character to avoid repetition
As your first number pick the rth digit in 123456 where r = 1 to 6. If r = 4, remove the 4th digit from 123456 to get 12356.
As your second number pick the rth digit in 12356 where r = 1 to 5. If r = 1, remove the 1st digit from 12356 to get 2356.
The third number is the rth digit in 2356 where r = 1 to 4. If r = 4, remove the 4th digit from 2356 to get 235.
The fourth number is the rth digit in 235 where r = 1 to 3. If r = 2, remove the 2nd digit from 235.
Conclusion: we picked 4142, but translated them to 4163, all different.
Wow! Thanks for the nice code Jan! And I really appreciate your explanation too.
This is definitely going into my VBA files!