Thread: UDF help please
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default UDF help please

Adam Kroger <adam_kroger wrote:
I need the following working UDF modified 2 ways

Function ROll2D6()
ROll2D6 = Application.RoundUp(Rnd() * 6, 0) + Application.RoundUp(Rnd()
* 6, 0)
End Function

Way 1:
accept 2 integer inputs
int1 will tell the number of instances of Application.RoundUp(Rnd() * 6, 0)
to sum
int2 will replace the 6 in Application.RoundUp(Rnd() * 6, 0)
an exit check for if my.cell ISNUMBER()=TRUE

Way 2:
accept 2 integer inputs
int1 will tell the number of instances of Application.RoundUp(Rnd() * 6, 0)
to sum
int2 will replace the 6 in Application.RoundUp(Rnd() * 6, 0)
an exit check if the cell to the right ="fail"

thanks



Function ROll2D6(times As Long, mult As Long)
Dim i As Long
For i = 1 To times
ROll2D6 = ROll2D6 + _
Application.RoundUp(Rnd() * mult, 0)
Next i
End Function


Don't understand


an exit check for if my.cell ISNUMBER()=TRUE