ElseIf
Posted by Bill Muirhead on July 16, 2001 12:05 PM
Can anyone tell me why the following code results in the error Compile Error: Else Without If? As far as I can tell it should work, but it doesn't.
JN = TextBox1.Text
Cells(NextRow, 7) = JN
If JN <> "" Then Cells(NextRow, 6) = "Y"
ElseIf JN = "" Then Cells(NextRow, 6) = "N"
End If
I have a text box on a form and I am transferring the contents to the next empty row at column 6. If there is no JN then I want to place N in the previous cell. If there is a JN then I want to place Y in the previous cell.
I know the answer must be simple but it eludes me.
Thanks for your help.
Bill M