View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Is If-Then Else limited to seven Elseif's??

No - as an example

Sub ABCD()
v = Int(Rnd() * 12 + 1)
If v = 1 Then
MsgBox 1
ElseIf v = 2 Then
MsgBox 2
ElseIf v = 3 Then
MsgBox 3
ElseIf v = 4 Then
MsgBox 4
ElseIf v = 5 Then
MsgBox 5
ElseIf v = 6 Then
MsgBox 6
ElseIf v = 7 Then
MsgBox 7
ElseIf v = 8 Then
MsgBox 8
ElseIf v = 9 Then
MsgBox 9
ElseIf v = 10 Then
MsgBox 10
Else
MsgBox "10"
End If
End Sub

works fine.

--
Regards,
Tom Ogilvy



"rudawg" wrote:

I seem to be running into the same limit as I would with a function of nested
ifs.