compare 2 mem variables against a string value

 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

0
Utf
1/7/2010 8:00:01 PM
excel.programming 6508 articles. 2 followers. Follow

3 Replies
642 Views

Similar Articles

[PageSpeed] 54

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
> 
0
Utf
1/7/2010 8:10:02 PM
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
> 
0
Utf
1/7/2010 8:12:01 PM
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
> 
0
Utf
1/7/2010 8:28:01 PM
Reply:

Similar Artilces:

Can't Create Appointments in OWA 2003 #2
I've just tried it again and it now works. We had trouble installing a mailbox antivirus product a few weeks ago and this highlighted an issue with our MDAC installation. MDAC was updated and repaired, going from version 2.6 to 2.8, and we think this is what resolved the issue. MDAC, it appears, had always been improperly registered and installed, ever since we upgraded the server o/s from 2000 to 2003 and performed a clean install of Exchange. My colleague, who resolved the issue with MDAC, used the following article and the software it refers to: http://www.macropool.com/en/do...

Copying values from a previous record to a current form
I have created a form that updates a table with bound edit box controls. The nature of our data is that for a given field in the table there may be a long sequence of repeat values from record-to-record, so, my form needs to populate the current bound edit box witha "default" value derrived from the field value from the previous record. In pseudocode I imagine something like: MyForm.MyEditBox = MyTable.Field1[CurrentRecord-1] If "CurrentRecord" was a pointer to the current record in the table being edited by the form, then the results of the expression right of th...

Assign Numeric Value to Text
Hi Everyone, I am looking for a way to assign numberical values to 2 different letters (i.e. A equal to 1, B equal to 2). Then what I am looking to do with this is add up, all the letters in numerical value, in a column and get a total on 1 row and then the average on a 2nd row. Any and all help is greatly appreciated. Happy New Years! :D --- Message posted from http://www.ExcelForum.com/ For a range A1:A100 with just one letter in each cell:- =SUMPRODUCT(CODE(UPPER($A$1:$A$100))-64) -- Regards Ken....................... Microsoft MVP - Excel Sys Spe...

Excel 2003 #2
I have Win XP Home. Anyway I am new to Excel. I want to figure out how to perform a PARTICULAR Custom format. I would like to select cells F3:f:6 and format them with a Custom format that makes them RED with 4 numbers in Parentheses. I tried going to format, cells, numbers, and custom. I tried every option listed in custom but nothing made the 4 numbers appear in paretheses. I got them red no problem but cannot get the numbers in parentheses. Any ideas? What am I missing? Someone told me to look for this in the Custom list : [Red](0000) I did not see this anywhere???? That format w...

linking forms in 2 files
Can you link forms like you can link tables? The reason I'm asking is that I have 1 master database and 3 user databases where I have linked the tables. Each database has the same form - for inputing data. If in the future, I want to make a change to the form, I want to do it only in the master database and have the other user databases update automatically. Is this possible? In Access 2000, under tools/database utilities, there is a menu item--database splitter. There isn't a lot about this in the online help that i could find. However, it is useful with multiusers. On Thu...

Downloading messages #2
After just installing Outlook, I find I have to manually Send & Receive to access my mail. How can I set up Outlook to automatically Send & Receive? "Kari" <anonymous@discussions.microsoft.com> wrote in message news:07fa01c3dea3$f8e182b0$a401280a@phx.gbl... > After just installing Outlook, I find I have to manually > Send & Receive to access my mail. How can I set up > Outlook to automatically Send & Receive? Tools-Send and Receive Settings-Define Send/Receive Groups and its at the bottom. ...

Disabling exchange mailboxes #2
Is it possible to disable a user's mailbox without it sending "Undeliverable" messages back to mail senders? ...

Money 2003 small business #2
Hello: Looking for info on being able to apply discounts automatically for certain customer invoices. Does Money 2003 for small business even allow you to do this? Thanks for the help! Bryan ...

Pivot Table Auto Update? #2
Wow - actually I hadn't. That's sort of embarassing :) thanks! mat -- mkaak ----------------------------------------------------------------------- mkaake's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=824 View this thread: http://www.excelforum.com/showthread.php?threadid=26202 ...

administrator email account can't thought POP3 send email after upgrade SP 1 or 2
Dear all, As title, when i upgrade ex SP1 and ex SP2, after that can't using roots to send email thought POP3, always prompt required auth, pls advise! In news:u37j7LTgGHA.3572@TK2MSFTNGP04.phx.gbl, Stanley <stanley@microosft.com> typed: > Dear all, > > As title, when i upgrade ex SP1 and ex SP2, after that can't using > roots to send email thought POP3, always prompt required auth, pls > advise! Hi - you don't send mail via POP - you send mail via SMTP. What happens when you authenticate to your SMTP server? What are the relay settings in your virtual...

Scribble #2
In the golden MFC example Scribble I found that the view repaint is rather sluggish after I scribbled up the whole client area. If I pop up a dialog and drag it across the painting area I can actually see the painting process around the dialog box and the drag isn't exactly smoothy. But there are more complicated windows application in which this slow repainting doesn't happen. For exam, in the traditional windows paint (mspaint.exe) program the repaint is rather fast that I simply could not feel it. Does mspaint has some sort of bitmap buffer that I can use to improve Scribble? Poss...

Inquiry Message:"Project Accounting information for this vendor does not exist. Do you want to Add the vendor's project information" #2
When I try to go past the Vendor ID in the Receivings Transactions Entry Window then the above message gets displayed. If I click Yes on the message then Vendor Maintenance Window gets opened. Even after filling all the fields and saving the Vendor Maintenance Window the same issue persists. Hi there When you say that you have filled in all the fields are you sure that you have clicked on the tab called 'Project' and then click on the 'OK' tab in there? (I am presuming that you wish to activate this Vendor to be used with Project Accounting.) Regards Sheila "s...

query export wont allow a zero value?
I runa query and forcing a specific value with a leading zero. i.e. 011210 When I run the export the first zero is eliminated. 11210 Any ideas why this happens? When ever I change the zero to a 1 or 2 works perfectly. The query always shows the correct value but the export text file is always off. Any ideas why? Thank you Is the field a number or text? Sometimes, if it is text it will drop leading zeros. -- Milton Purdy ACCESS State of Arkansas "Vadimbar" wrote: > I runa query and forcing a specific value with a leading zero. > i.e. 011210 &...

Formula Help Please #2
When I paste a take out sample into VLookup, I need the response from the array to indicate 14 days either side of the dates pasted, both 1 year and 2 years prior with "!seed sow window" The following works fine with 1 year prior, =IF(AND($A$47057-D2>351,$A$47057-D2<379),"!seed sow window","") Can someone add/include the appropriate statement to show(include) 2 years prior please? (eg(AND($A$47057-D2>716,$A$47057-D2<744),"seed sow window","") (the day parameters are 716 low and 744 high) Thank you very much. rodney@touch88gum.c...

ActiveX Issue #2
We currently use Javascript to launch the outlook from the web application interface (web browser). It can launch successfully, but when the user close the outlook, and then relaunch again, there's always error and the outlook is not open. I check through the task manager and found that outlook process is still there. Any idea on the problem? Below is the javascript code: outlookApp = new ActiveXObject("Outlook.Application"); if (outlookApp.Explorers.Count > 0) { outlookApp.Explorers.Item(1).display(); outlookApp.Explorers.Item(1).windowstate = 0; ...

pass table-valued param to table-valued function
Can you pass table-valued parameters to table-valued functions? (or any user-defined function)? The first paragraph on http://msdn.microsoft.com/en-us/library/bb510489.aspx says you can pass table-valued parameters to a function. Unfortunately, the code sample on that page only shows passing to a stored procedure. I have not found an example of passing one to a function anywhere on the web. I can successfully pass table-valued parameters to stored procedures, but how do I pass them to functions? Any example would be appreciated. Here is one example: CREATE TYPE Foo AS...

Setting Email Subject value same as regarding
Hi, In version 1.2, is it possible for us to customize the email subject so the value defined on regarding can be copied into Email subject? Thx, Carrie UNfortunately, there is no supported way to modify any of the activities within CRM v1.x. You could try adding some upsupported javascript though to the email forms to enable this. -- Matt Parks MVP - Microsoft CRM "Carrie" <Carrie@discussions.microsoft.com> wrote in message news:79C33DE1-870B-412C-87BD-535C31498DEC@microsoft.com... Hi, In version 1.2, is it possible for us to customize the email subject so the value...

vlookup with 2 conditions?
hi- i need to return a value based on 2 conditions... i have a list of 500+ names, they all have a unique identifier (employee id) so i need to get different values/scores from tab 2 into tab 1. so, for john i'd have his score from category 1 (80%) in tab 1 C2 and his score for category 2 (20%) in D2 and son on. i did a simple v-lookup =(VLOOKUP(C$2,Tab 2!$A:$C,3,FALSE)) BUT it gives me the first score it finds that matches the category name and I need to score for each category for each employee... any ideas??? tab 1: A B C ...

SQL 2005 Standard & RMS HQ v1.2
Has anyone had any problems getting RMS HQ (v1.2) admin to connect to an RMS HQ Db sitting on SQL 2005 Standard server?. The same HQ Db connected to a SQL 2000 server connects with no problems. The brand new 2005 sever allows me to use RMS HQ Admin/Manager locally but not on a client PC on the same LAN? HQ Admin Error says: "To connect to this server you must use SQL Server Management Studio or SQL Server Management Objects (SMO)". The windows firewall feature on the new server is swtiched off and both (TCP) 1433 & (UDP) 1434 Ports are open. Anybody got any ideas? have ...

saving excel as webpage so that hyperlinks load into different window #2
doesn't work, target="_new" isn't an html ta -- rsa ----------------------------------------------------------------------- rsai's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1542 View this thread: http://www.excelforum.com/showthread.php?threadid=27031 ...

Data Validation #2
Basically there are three categories from which the user can selec from. Eg Issues Sub-issues Services-issues - servicing - assessing - delay in assessing - call centre - misquote - information - website (no entry required) - brochure I would like the sub-issues and services-issues to depandant on th issue first chosen, thus limiting the selection on the subissue an servicing-issues drop down. Is this possible in Exce -- Message posted from http://www.ExcelForum.com Hi Pascale check out Debra Dalgleish's site espe...

Set Form Modal and Popup values to True
I'm using the API call to hide the Access window. Because of this, all of the forms in my application have to have their Popup and Modal properties set to True, but this limits editing capability during design, so I frequently change these values to False (manually). What I'm wondering is how to do this programmatically. I tried looping through the forms in the AllForms collection, but I couldn't figure out how to actually set the values through the code. What I want to do is write a subroutine that will change these values for all of my forms to either true or false and...

2 sided printing in publishing
Is there an easy way to print both sides of a publisher catalogue? I make booklets on heavy paper and want to use both sides; so that when it is bound, I don't have blank back sides. judyt <judyt@discussions.microsoft.com> was very recently heard to utter: > Is there an easy way to print both sides of a publisher catalogue? I > make booklets on heavy paper and want to use both sides; so that when > it is bound, I don't have blank back sides. You could buy an auto-duplex module for your printer, or you could manually turn the paper over to print the reverse side. -...

Format a worksheet to carry out all calculations to 2 decimal plac
Hi, Is it possible to format am excel worksheet or whole workbook to carrry out all calculations to 2 decimal places (ie. rounding up and down)? The problem I have is that I use Excel to track expenses tha are also enetered in an accounting package and get rounding errors as excel doesn't round calulations up or down while the acounts package does. I can get excel to display to two decima places and round an individual value to 2 places, but don't know how to get teh whole worksheet to calculate to 2 decimal places. Thanks, Phill. See one answer at your other post. In arti...

ORA-01008: not all variables bound error when using MFC CRecordset::Requery
Hello, I've got a problem using the MFC CDatabase and CRecordset C++ classes with the Oracle ODBC driver. After successfully opening a database connection and retrieving data using a recordset, I want to rebuild the recordset using a new filter parameter value. Setting a new filter value and calling the CRecordset::Requery() function should do the trick but it always results in an "ORA-01008: not all variables bound" error. I attached some sources and an ODBC trace captured when the error occurs. Got any ideas what's wrong? Any help in resolving that issue would be greatl...