EXCEL VBAselect大小写错误检查

我想做一个错误检查,如下面的代码部分。 但是,我不知道该怎么做。 请提供一些指导。 提前致谢。

Select Case Trim(y) Case Is = "" MsgBox ("Empty field!") Case (UCase(Left(y, 1)) = "=") '<--This line requires guidance MsgBox ("invalid input") End Select 

这不会编译。 而是尝试

 Select Case UCase(Left(Trim(y), 1)) Case "" MsgBox ("Empty field!") Case "=" MsgBox ("invalid input") End Select 

有关如何构build您的select或是否使用它的select(例如,您可以select级联if语句):

 Select Case Left(y,1) Case "=" MsgBox ("invalid input") Case Else If Trim(y) = "" Then MsgBox ("Empty field!") End If End Select