compare 2 mem variables against a string value

R

Ron5440

Hey,
Can anyone help here...

If Mdl = "ZDX" Then 'Works fine
If Mdl or Mdl2 = "ZDX" Then 'Generates Type mismatch error

Does anyone know how to check more than one memory variable (Mdl and Mdl2)
against a string value?

Thanks,
RR
 
R

Ryan H

I made this same mistake when I was beginning to learn VBA. This is the way
to do it:

If Mdl = "ZDX" OR Mdl = "ZDX" Then
' do something
End if

Hope this helps! If so, click "YES" below.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top