Your missing the END SELECT
Select Case myValue
Case "hello"
Case "foobar"
Case else
End Select
Its a VERY good idea to get into the habit of immediately closing a
statement when required when you open it, BEFORE you write any code. So
if you're writing a Select Case, you would type
Select Case
End Select
right off the bat.
Am I the only or are there others that thing that it would be a great
addition to VBA for VBA to automatically close a statement when needed,
in the same way that typing Sub or Function automatically adds the End
Sub or End Function statements
David H
Kirk P. wrote:
> I've got a Select Case function like this:
>
> Public Function AcctClass2(GLAccount As String)
>
> Select Case GLAccount
> Case 100010 To 100037, 102242, 102250, 102280, 10231X
> AcctClass2 = "Cash"
>
> GLAccount is a text field that I'm feeding to this function as an argument.
> It doesn't like the X at the end of the Case line, and I get a compile error.
> How do I handle this statement to include the X?
|