我有以下无效的代码:
Dim ReturnType As String
ReturnType = UCase(Application.InputBox("Enter Return Type (ABC, BCD, CDE): ", "Input Box Text", Type:=2))
If Not IsError(Application.Match(Left(ReturnType, 1), Array("ABC", "BCD", "CDE"), 0)) Then
If CBool(InStr(1, ReturnType, "ABC", vbTextCompare)) Then
Range("A1") = "ABC"
End If
If CBool(InStr(1, ReturnType, "BCD", vbTextCompare)) Then
Range("A2") = "BCD"
End If
If CBool(InStr(1, ReturnType, "CDE", vbTextCompare)) Then
Range("A3") = "CDE"
End If
End If
但是,如果我只是简单地将输入更改为“ A”,“ B”和“ C”,那么它将起作用。我认为这与重叠的字母有关。有办法解决这个问题吗?
谢谢