02-27-2014, 06:52 AM
Hello experts, I am new to IT and trying to learn to script but unable to understand why I need EndIf four times in below script at the end for it to work. I have been writing other ElseIf statements and used EndIf only once at end of script and they worked fine but this one is requiring it 4 times. ??
Quote:Dim State, Region
State=Inputbox ("Enter a State")
Region=Inputbox ("Enter a Region")
If state= "AP" Then
If Region= "Telangana" Then
msgbox "Hello Reddy"
msgbox "Dist count is 10"
Else if Region= "Rayalasema" Then
msgbox "Hello GCR"
msgbox "Dist count is 4"
Else If Region= "Costal" Then
msgbox "Hello mohan"
msgbox "Dist count is 9"
End If
End If
End If
End If