LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
Adam Kroger
 
Posts: n/a
Default simple (i think) UDF debug help needed

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Array formula needed ZipCurs Excel Worksheet Functions 4 December 17th 05 02:16 PM
Looking to create a simple user form with lookup Tim Excel Discussion (Misc queries) 5 November 14th 05 04:57 PM
Simple (I Think) Date Formula Needed Big Rick Excel Discussion (Misc queries) 4 September 15th 05 01:47 AM
Help with what should be a simple formula B Millar via OfficeKB.com Excel Worksheet Functions 2 June 16th 05 04:18 PM
Simple Excel operation, help needed [email protected] Excel Discussion (Misc queries) 5 May 9th 05 08:10 PM


All times are GMT +1. The time now is 11:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"