I'm trying to write code that does the following in VBA but i get error: Type mismatch
Quark is a string variable
If quark = "F" Or "DE" Or "ED" Then
Join Stack Overflow to learn, share knowledge, and build your career.
Each "OR" is its own boolean statement.
If quark = "F" Or quark ="DE" Or quark ="ED" Then
You could acheive what you are trying to do with a case though I think
Select Case quark
Case "F","DE","ED"
stuffHere
end select
EDIT: I see that you were getting a type mismatch, did you dim quark as a string?
dim quark as string
You may try like to compare like this:-
If quark = "F" Or quark = "DE" Or quark = "ED" Then
instead of:-
If quark = "F" Or "DE" Or "ED" Then
You need to compare quark to the strings.
If quark = "F" Or quark = "DE" Or quark = "ED" Then