If - End if problem
I tried that but the program "corrects" it automatically to make it Else: if.
I was also getting a similar error of elses without ifs until I put it all
on one line.
"Conan Kelly" wrote:
Papa Jonah,
Use "ElseIf" instead of "Else: If" and "Else" instead of "Else:"
Also, it looks like you are trying to do If...Then...ElseIf...Then...Else
all on one line. If I remember correctly, this is possible and you don't
need the "End If" to terminate it (don't know if it will ignore it if it is
there....haven't tried that).
To do it on multiple lines, use this ("End If" is required):
If locale = "P" Then
Selection.Interior.ColorIndex = 3
ElseIf locale = "L" Then
Selection.Interior.ColorIndex = 6
Else
Selection.Interior.ColorIndex = 9
End If
HTH,
Conan
"Papa Jonah" wrote in message
...
What is wrong with this?
If locale = "P" Then Selection.Interior.ColorIndex = 3 Else: If locale =
"L"
Then _
Selection.Interior.ColorIndex = 6 Else: Selection.Interior.ColorIndex = 9
End If
I keep getting an End If without If block error. I don't understand the
help.
I have an If statement and and End If statement.
Papa J
|