Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This is my first time writing a new UDF :)
The error reported by debug is: "Block IF without End IF" the highlight is on "next i" Function con_check(con_old, con_now) Dim i As Integer Dim targ As Integer Dim hit As Integer Dim roll As Integer If con_old < con_now Then For i = 1 To con_count hit = hit + 1 If hit < 3 Then targ = 1 + hit If 3 < hit < 6 Then targ = hit + 6 If hit 5 Then myCell.Value = "DEAD" End If End If roll = Application.RoundUp(Rnd() * 6, 0) + Application.RoundUp(Rnd() * 6, 0) If roll targ Then myCell.Value = "PASS" Next i Exit Function Else: myCell.Value = "FAIL" Exit Function End If End If End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Array formula needed | Excel Worksheet Functions | |||
Looking to create a simple user form with lookup | Excel Discussion (Misc queries) | |||
Simple (I Think) Date Formula Needed | Excel Discussion (Misc queries) | |||
Help with what should be a simple formula | Excel Worksheet Functions | |||
Simple Excel operation, help needed | Excel Discussion (Misc queries) |