I was looking for the same and came up with the following workaround.
It is specifically geared towards a game that uses six-sided dice to beat a target number (TN) where the number of dice rolled can be anywhere from 1 to n, using the following specifics.
Sub TNCheck1()
Dim i As Long, r As Long, d As Long, x As Long, cell As Range, TarN As Long
'(1) First I get the number of dice to roll from the appropriate Input cells.
'(2) The range for dice roll results and number of rolls is going to be C11:D*, so I clear that area.
'(3) Entirely optional, but I want to exit the sub if I don't have valid numbers...
'(4) ...which I check for next.
'(5) This is the range where results are stored.
'(6) The "roll" itself.
'(7) Result is stored in the range.
'(8) Notation for how many times this "die" has been rolled.
'The next section is simply looping through the results and checking if any die should be rolled again, for as long as our condition of having rolled consecutive 6's is met.
'(A) Tag which marks the beginning of the loop.
'(B) Resetting the counter x.
'(C) The number of times the die has been rolled.
'(D) Checking if the previous result has a 6:1 result/roll ratio.
'(E) If there is a current 6:1 result/roll ratio: die is rolled, result is added, and roll count is updated.
'(F) IF the counter x is greater than 0 we go back to (A) again.
d = WorksheetFunction.Sum(ActiveSheet.Range("D6:D7")) '(1)
ActiveSheet.Range("C11:D1048576").ClearContents '(2)
TarN = ActiveSheet.Range("D5").Value '(3)
If TarN = 0 Or d = 0 Then '4)
Exit Sub
Else
For Each cell In ActiveSheet.Range("C11:C" & 10 + d) '(5)
r = WorksheetFunction.RandBetween(1, 6) '(6)
cell.Value = r '(7)
cell.Offset(0, 1).Value = 1 '(8)
Next cell
Gandalf: '(A)
x = 0 '(B)
For Each cell In ActiveSheet.Range("C11:C" & 10 + d)
i = cell.Offset(0, 1).Value '(C)
If cell.Value / cell.Offset(0, 1).Value = 6 Then '(D)
r = WorksheetFunction.RandBetween(1, 6) '(E)
cell.Value = cell.Value + r
i = i + 1
cell.Offset(0, 1).Value = i
x = x + 1
End If
Next cell
If x > 0 Then '(F)
GoTo Gandalf
Else
End If
End If
End Sub
I lead my response with the above, because the understanding the logic can be helpful as a starting point for anyone who use the search query "VBA exploding dice".
Now, to answer the question proper, using the above logic:
Sub XP10()
Dim r As Long, cell As Range
Set cell = ActiveSheet.Range("A1")
r = WorksheetFunction.RandBetween(1, 10)
cell.Value = r
If cell.Value = 10 Then
GoTo xplUp
ElseIf cell.Value = 1 Then
GoTo xplDown
Else: GoTo Complete
End If
xplUp:
r = WorksheetFunction.RandBetween(1, 10)
If r = 10 Then
cell.Value = cell.Value + r
GoTo xplUp
Else:
cell.Value = cell.Value + r
GoTo Complete
End If
xplDown:
r = WorksheetFunction.RandBetween(1, 10)
If r = 10 Then
cell.Value = cell.Value - r
GoTo xplDown
Else:
cell.Value = cell.Value - r
GoTo Complete
End If
Complete:
End Sub