Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
The correct syntax is If Mdl = "ZDX" Or Mdl2 = "ZDX" Then Mike "Ron5440" wrote: 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this
If Mdl="ZDX" or Mdl2 = "ZDX" Then -- If this helps, please remember to click yes. "Ron5440" wrote: 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. -- Cheers, Ryan "Ron5440" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Value compare problem, As Single variables Feb09 | Excel Programming | |||
Compare variables in two excel workbooks | Excel Programming | |||
String variables | New Users to Excel | |||
Compare two variables across two worksheets | Excel Worksheet Functions | |||
Compare two lists with two variables | Excel Worksheet Functions |