ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   error 13 type mismatch input box (https://www.excelbanter.com/excel-discussion-misc-queries/246835-error-13-type-mismatch-input-box.html)

cluckers

error 13 type mismatch input box
 
I am getting an error 13 type mismatch on line "If Not comtypeeq = "C" Or "P"
Or "" Then"

can you help?

Thanks

Code:
Dim comovrdeq As String
Dim comtypeeq As String
Dim comovrdmf As String
Dim comtypemf As String

commissionadjust:

If MsgBox("Do you want to discount the commissions?", vbYesNo) = vbYes Then
comtypeeq = InputBox("Enter override type: cents/share = C; Percent
discount= P; dollar amount/trade = leave blank")


If Not comtypeeq = "C" Or "P" Or "" Then
MsgBox ("You did not select a valid discount. Try Again")
Else




JLatham

error 13 type mismatch input box
 
You have to be explicit with each test:

If comtypeeq< C" and comtypeeq < "P" And comtypeeq<"" Then
....
Else
....
End IF

"cluckers" wrote:

I am getting an error 13 type mismatch on line "If Not comtypeeq = "C" Or "P"
Or "" Then"

can you help?

Thanks

Code:
Dim comovrdeq As String
Dim comtypeeq As String
Dim comovrdmf As String
Dim comtypemf As String

commissionadjust:

If MsgBox("Do you want to discount the commissions?", vbYesNo) = vbYes Then
comtypeeq = InputBox("Enter override type: cents/share = C; Percent
discount= P; dollar amount/trade = leave blank")


If Not comtypeeq = "C" Or "P" Or "" Then
MsgBox ("You did not select a valid discount. Try Again")
Else





All times are GMT +1. The time now is 02:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com