compare 2 mem variables against a string value

  • Thread starter Thread starter Ron5440
  • Start date Start date
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
 
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.
 
Back
Top