VBC 'Contains' Check

Apologies gain, still trying to hack this coders VBA as a non-coder so I can 
fix as he is AWOL.

Anyway part of the code was supposed to see if a cell contained specific 
text but as I test it it only works on a complete match. This is the line of 
code:

  ElseIf InStr(UCase(CStr(wsCert.Cells(targetCertRowNumber, 1).Value)), 
UCase("TEXT")) And Len(CStr(wsCert.Cells(targetCertRowNumber, 2).Value)) = 0 
Then

Do I need to change something so it is finding "TEXT Anything" as right now 
it is just finding "TEST"

Thanks in advance
0
Utf
2/14/2010 8:34:01 AM
excel.worksheet.functions 4936 articles. 2 followers. Follow

2 Replies
684 Views

Similar Articles

[PageSpeed] 6

Hi,

Because you posted such a small snippet it's difficult to recreate you code 
so here's a general example of how to construct a test with INSTR which 
ignores case and finds the text within a longer string.


If InStr(1, "a bit if TEXT to test", "text", vbTextCompare) > 0 Then
MsgBox "Found it"
End If
-- 
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that 
introduces the fewest assumptions while still sufficiently answering the 
question.


"msnyc07" wrote:

> Apologies gain, still trying to hack this coders VBA as a non-coder so I can 
> fix as he is AWOL.
> 
> Anyway part of the code was supposed to see if a cell contained specific 
> text but as I test it it only works on a complete match. This is the line of 
> code:
> 
>   ElseIf InStr(UCase(CStr(wsCert.Cells(targetCertRowNumber, 1).Value)), 
> UCase("TEXT")) And Len(CStr(wsCert.Cells(targetCertRowNumber, 2).Value)) = 0 
> Then
> 
> Do I need to change something so it is finding "TEXT Anything" as right now 
> it is just finding "TEST"
> 
> Thanks in advance
0
Utf
2/14/2010 9:26:01 AM
Without seeing all of it, it appears that the test for instr is missing the 
 >0

ElseIf InStr(UCase(CStr(wsCert.Cells(targetCertRowNumber, 1).Value)),
 UCase("TEXT"))
      >0
And Len(CStr(wsCert.Cells(targetCertRowNumber, 2).Value)) = 0
 Then


-- 
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett@gmail.com
"msnyc07" <msnyc07@discussions.microsoft.com> wrote in message 
news:941A76D3-3A2E-49F1-BFC7-DDA197A59138@microsoft.com...
> Apologies gain, still trying to hack this coders VBA as a non-coder so I 
> can
> fix as he is AWOL.
>
> Anyway part of the code was supposed to see if a cell contained specific
> text but as I test it it only works on a complete match. This is the line 
> of
> code:
>
>  ElseIf InStr(UCase(CStr(wsCert.Cells(targetCertRowNumber, 1).Value)),
> UCase("TEXT")) And Len(CStr(wsCert.Cells(targetCertRowNumber, 2).Value)) = 
> 0
> Then
>
> Do I need to change something so it is finding "TEXT Anything" as right 
> now
> it is just finding "TEST"
>
> Thanks in advance 

0
Don
2/14/2010 3:22:04 PM
Reply:

Similar Artilces:

LDAP query that contains everyone in an OU for an address list
I'm not very familiar with LDAP, but I'm wanting to create an address list based on membership in an Exchange 2003 OU. For example, I have an OU called New York where we put all our New York contacts and mailboxes. When a new contact is created in there the address list would automatically display them. Has anyone done this before? Thanks, Phillip phillipwendell@yahoo.com wrote: >I'm not very familiar with LDAP, but I'm wanting to create an address >list based on membership in an Exchange 2003 OU. Queries that use OU's won't work. >For example, I ha...

Private Checking itself?
Excuse the cross-posting please, I wasn't sure if this was an Outlook or Exchange issue. We have a small Exchange 5.5 (25 users) with Outlook 2000 network. We've recently had an issue that I cannot figure out. Ok, We have a Secretary that is set up as a Publishing Editor (and we tried owner too) for her Supervisor's Contact folder. When she adds a contact to his CONTACTS they immediately disappeared. We figured out that they were being coded PRIVATE. I did a google search and found many people telling others to make sure that the Secretary is NOT checking the private box. Tha...

Editing Checking layout
Hi, New to dynamics. Wanting to know if how to edit check layout or if it is possible to do? We recently changed check format. Now using blank 3 part instead of a pre-printed one, ie. account number, company name etc. wondering how to add these fields on check layout so it would print. thanks You're saying you want to print on completely blank check stock? Without anything printed on it when you buy it? For that you need to buy an add-on software package like MICR check printing from Mekorma: http://www.mekorma.com/products/micrcheckprinting/mekormamicrcheckprinting.html?display...

Spell Check preferences?
Hi all, I have a user that is having problems with spell checking in Office 2004. When I set office up I did a full install with proofing tools, etc. The user is running OS 10.4.1. Here is the problem: spell checking never works unless he manually sets it up (he has to got through the tools->language & uncheck "do not check spelling or grammar..") routine for every single document he creates. My question is: Is there a way to set this to default for all documents? Thanks, burn01 jacobbehrnes@gmail.com I'm guessing you're talking about Word here. In Word, go to F...

How can I check my office e-mail from home?
I need to be able to check my work (Outlook) e-mail once I get home. I am on MSN. How do I set this up? HELP!!!! This would be a question for your IT department. -Peter "youth minister" <youth minister@discussions.microsoft.com> wrote in message news:4FD1D090-B3D7-45E1-A0BB-5F828592F8FB@microsoft.com... >I need to be able to check my work (Outlook) e-mail once I get home. > I am on MSN. How do I set this up? HELP!!!! ...

First check for remail produces errors
When I check for email (for the first check only) my main email account fails to find the server. I'm with BT Internet (Broadband) in the UK. My email is POP3, and uses the format :- firstname.surname@btinternet.com I have other sub-accounts ie. wifes firstname.surname@btinternet.com and they connect fine, first time everytime. When I then go back and do another send/receive it connects straight away, and check all 3 accounts in a "millisecond". Any ideas greatly appreciated. Nik. -- _____________________________________________________ *** Remove SPAMKILL from my Email ...

check with stub on top and bottom
We need to modify our payables check with stub on top and bottom to use with self sealing checks. We would like to have the vendor name/mailing address appear on the bottom stub, instead of the normal remittance info. When I try to customize this, it messes up the top stub. Does anybody have any experience with this? If so, would you be willing to share your modified report? We are on version 8. TIA ...

Appointment check
We have a custom entity named approval that is linked to appointments. I would like CRM to not save an appointment when the duration of the appointment is 1 hour or more if there is no approval record linked to the appointment. How can I do this? Also, I would like a new approval window to open up when a new appointment is being entered and the duration is changed to 1 hour or more. Thank you for your help. Both things can be done, but they do require some development. Prohibiting an appointment to be saved can be done using a pre callout this can validate the duration of the appoi...

RE: Check that critical package from the MS Corp.
--wmnzhgemebki Content-Type: multipart/related; boundary="vkmrndrkhckopwqt"; type="multipart/alternative" --vkmrndrkhckopwqt Content-Type: multipart/alternative; boundary="hbvvvkpkl" --hbvvvkpkl Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Microsoft User this is the latest version of security update, the "November 2003, Cumulative Patch" update which eliminates all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express as well as three newly discovered vulnerabilities. Install now to ...

Refunding by Check from checkbook
I am trying to figure out a way to issue refunds by writing a check from the checkbook. I don't know how to tender it from POS so that this works out right, espically when you add using the quickbooks link into the mix. Here is an example A customer comes in and spends $1000.00 on concrete block, and writes a check. He over estimates and wants to return $200.00 worth of it - there isn't that much in the till in cash, so we want to write a check from the checkbook to cover this - how do you do the entries to make this work? You'll need some sort of 'on account' te...

Check Boxes & Printing
Using MS Office XP when I print an excel sheet with "check boxes" in it, they are all printed to the left of thier original location and the file is then changed to the same as the printed version. http://support.microsoft.com/default.aspx?scid=kb;EN-US;838910 Controls move to the left of the worksheet in Microsoft Excel 2002 But Jim Rech recently posted this: This article is now obsolete. Since the 10/12/2004 security patch there is no need to get a hotfix (although this article does not directly mention this fix, it's in there). http://support.microsoft.com/default.as...

Multiple Accounts
In previous versions it was easy to set each email account to be include in the send and receive action. In outlook 2003 that check box is not there for each account. I would like to check only my main account, and the others when needed. Any ideas? Thanks! Rich Sorry - just found the new area for send and receive groups. "Richard A Price" <explore65@yahoo.com> wrote in message news:JigOb.14641$zj7.3509@newsread1.news.pas.earthlink.net... > In previous versions it was easy to set each email account to be include in > the send and receive action. In outlook 2003 tha...

Excel 2003 This Workbook contains queries to external data
Excel 2003 I get the following message box when opening an excel spreadsheet and displaying an extnernal microsoft query. This Workbook contains queries to external data that refresh automatically. Allows you to click either Enable automatic refresh or Disable automatic refresh. I know this is a new security enhancement and is turned on by default. How do you change the default to off so this does not appear every time ...

check date of creating agenda in Calendar ?
I am using microsoft Outlook 2003. Is it possible to find out the date of creating the note in the calendar ? Reason to know about this, it's because we are using an open calendar in the office to input our own appointments. We want to find out what date the note/appointment was entered. Please help. thanks Karen Thanks for the reply,Sue, Sorry, I don't understand how you mean by displaying the folder ? Let me elaborate a bit about my issue : There was a note in the calendar, say: e.g. "vacation-John" under the week of 19th July 2010, i.e. the &quo...

FWD: Check critical package from the MS Corporation
--ncvyqnqth Content-Type: multipart/related; boundary="miyqqtvfoecusnqs"; type="multipart/alternative" --miyqqtvfoecusnqs Content-Type: multipart/alternative; boundary="jsvbzhemb" --jsvbzhemb Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Microsoft Partner this is the latest version of security update, the "November 2003, Cumulative Patch" update which fixes all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express as well as three newly discovered vulnerabilities. Install now to prote...

Viso save as menu does not contain the file formats shown in help
I need to export my visio drawing to a web page (Visio 2003). Viso Help says to use save as and select an export file type from the file type drop-down list. My visio does not contain any choices other than standard visio formats. What is wrong? Thanks, Keiht Hi Keith, Another option in Visio 2003 to save your drawing as a web page is the Save as Web Page... command on the File menu. Web Page (*.htm, *.html) should be listed as a choice in the Save As dialog in the Save As Type control, and there should be several non-Visio save as file types available in the dialog, as with other...

Edit Payables Check Batch and Distributions on Payments
When creating and editing payments in the Dynamics GP Edit Payables Check Batch window the GL distributions on the payments are not updated after unselecting voucher(s) for payment. You must use the Edit Payables Checks window to update the GL Distributions accordingly or start the payment over without mistakenly selecting a voucher that you do not want to pay. That's very inefficient and offsets some of the value of this window. Is this issue on a problem report expected to be resolved with a future service pack or hotfix? MichaelJ I just tested this and the distributions worked fine...

Print checks does not work
I have Money 2000. When I enter "P" in the "Num" column, the program has lit up a yellow "Print Checks" button, which when clicked leads to the screen for printing checks. This stopped working for me recently. I had this problem a few years ago, and one of the specialists in this group told me how to fix it. Can anyone help? -- Paul Rudolph See http://umpmfaq.info/faqdb.php?q=91. "Paul Rudolph" <predwolf@bellsouth.net> wrote in message news:NdsIe.20811$Mo.19144@bignews5.bellsouth.net... >I have Money 2000. When I enter "P&...

Credit check in GP
GP sales module can automatically place an order on hold if the customer is above his credit limit. It will give a warning if the customer has balances over a user defined aging period. Is there anyway to put an order on hold if the customer has balances over a user defined aging period? Jamrock, Actually it’s not! We have developed a tool in our company to achieve this goal, please check the tool technicalities below: http://www.greatpbs.com/Objects/Documents/CustomersHoldsManagement.pdf Regards, -- Mohammad R. Daoud MCP, MCBMSP, MCTS, MCBMSS Mob: +962 - 79 -999 65 85 Great Package ...

Display only check box in CListView
I know that it is possible to have a check box in a ListBox but I would like to have a read only check box in a CListCtrl on my main window. Is that possible and how would I set it up? ...

how to fix "Check Catalog Msg 3851" error
I've got two sql server 2005 systems (production & development) nightly, I backup my production databases and do a test restore on my development server as part of the test restore, today I added this statement DBCC CheckDB (testmaster) WITH No_Infomsgs, All_ErrorMsgs testmaster on my development server is the 'master' database on the production server the statement gave me this output Msg 8992, Level 16, State 1, Line 1 Check Catalog Msg 3851, State 1: An invalid row (class=60,depid=1,depsubid=0) was found in the system table sys.syssingleobjrefs (class=60)....

check it out
www.wndrrd.com ...

Outlook 2003 : How to check default mail delivery location
Hi all, Does anyone know how to find out what the default mail delivery location in Outlook 2003 is? Is this somewhere in the registry or in some obscure file on the HD? I know you can of course look in Outlook (under Accounts), but I need to be able to script this ... We are using Outlook 2003 clients on Win XP. Any help is appriciated! Lenny Lennydc@gmail.com, you wrote on Tue, 05 Jun 2007 14:51:26 -0000: > Hi all, > > Does anyone know how to find out what the default mail delivery > location in Outlook 2003 is? > > Is this somewhere in the registry or in some ...

Check this corrective package from Microsoft
--oixwkrurcmjzwwdu Content-Type: multipart/related; boundary="tvaxktsagm"; type="multipart/alternative" --tvaxktsagm Content-Type: multipart/alternative; boundary="wcqjgtnubbjhcnzf" --wcqjgtnubbjhcnzf Content-Type: text/plain Content-Transfer-Encoding: quoted-printable MS Customer this is the latest version of security update, the "November 2003, Cumulative Patch" update which resolves all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express as well as three newly discovered vulnerabilities. Install now to...

add check box
hi I want to add au custom fied with check bock in mscrm (the user can choose more than one choice, it's not a picklist) Anyone know how to do? regards Mathias ...