

IntWhite2 = Application.Index(rngWhite2, Application.RandBetween(1, 6)) IntWhite1 = Application.Index(rngWhite1, Application.RandBetween(1, 6)) IntBlack = Application.Index(rngBlack, Application.RandBetween(1, 6)) functionname or Application.functionname. You can't use Excel worksheet functions directly in VBA, you must use either Application.WorksheetFunction. This is my first try at using native Excel functions in VBA and I am stuck. I have the Analysis Tool Pak Add-In installed and have atpvbaen.xls in the project references.
Dice roll app for skype code#
The code breaks at the start of the first INDEX. IntRollResult = intBlack + intWhite1 + intWhite2 IntWhite2 = Index((rngWhite2), RandBetween(1, 6)) IntWhite1 = Index((rngWhite1), RandBetween(1, 6)) IntBlack = Index((rngBlack), RandBetween(1, 6)) 'The second white die faces are 0,1,2,3,4,5 and stored in worksheet cells C2-C7ĭim rngBlack As Range, rngWhite1 As Range, rngWhite2 As Rangeĭim intBlack As Integer, intWhite1 As Integer, intWhite2 As Integer, intRollResult As Integer 'The first white die faces are 0,0,1,2,3,4 and stored in worksheet cells B2-B7 If you want a different set supported, check out the about page. The unique dice and rules from Edge of the Empire are also here. 'The black die faces are 1,2,2,3,3,3 and stored in worksheet cells A2-A7 Roll Dice with Friends supports polyhedral dice for role-playing games such as Dungeons & Dragons or Pathfinder, or any game that needs a set of basic dice. 'Simulate a dice roll consisting of (3) 6-sided custom dice, 1 black and 2 white I am attempting to code a dice roll simulation in Excel 2007 VBA.
