Capturing "text" instead of the formula

I have the following code snippet:

Pass = 0
Fail = 0
For i = 9 To (ZeroRow - 3) Step 8
    If Cells(i, "H").Value = Pass Then
        Pass = Pass + 1
    Else
        Fail = Fail + 1
    End If
Next

The cells I'm referring to actually have formulas in them but when you look 
at the worksheet the cells have either "Pass" or "Fail" in them.  That's what 
I'm trying to capture.  But when I run this code it doesn't see "Pass" in any 
of the cells so all of them in the for loop get assigned to Fail.  I've tried 
putting the word Pass in quotes:

If Cells(i, "H").Value = "Pass" Then

but that doesn't work either.  How can I fix this?
0
Utf
2/4/2010 5:04:01 PM
excel.programming 6508 articles. 2 followers. Follow

1 Replies
743 Views

Similar Articles

[PageSpeed] 57

Hi,

Try this

Dim Pass As Long, i As Long
Dim Fail As Long, ZeroRow As Long
Pass = 0
Fail = 0
For i = 9 To (ZeroRow - 3) Step 8
    If UCase(Cells(i, "H").Value) = "PASS" Then
        Pass = Pass + 1
    Else
        Fail = Fail + 1
    End If
Next


-- 
Mike

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


"Bishop" wrote:

> I have the following code snippet:
> 
> Pass = 0
> Fail = 0
> For i = 9 To (ZeroRow - 3) Step 8
>     If Cells(i, "H").Value = Pass Then
>         Pass = Pass + 1
>     Else
>         Fail = Fail + 1
>     End If
> Next
> 
> The cells I'm referring to actually have formulas in them but when you look 
> at the worksheet the cells have either "Pass" or "Fail" in them.  That's what 
> I'm trying to capture.  But when I run this code it doesn't see "Pass" in any 
> of the cells so all of them in the for loop get assigned to Fail.  I've tried 
> putting the word Pass in quotes:
> 
> If Cells(i, "H").Value = "Pass" Then
> 
> but that doesn't work either.  How can I fix this?
0
Utf
2/4/2010 5:12:02 PM
Reply:

Similar Artilces:

Slanted Text
I would like to make a matrix with slanted column headings. I can slant the text but the text is truncated the above & below rows. How do I get slanted text? Thank you Mike, Have you set the Wrap Text option in Format>Cells>Alignment, and made the row higher? -- HTH Bob Phillips "Mike" <mikedenton81@yahoo.com> wrote in message news:0c0a01c3621d$92c65170$a101280a@phx.gbl... > I would like to make a matrix with slanted column > headings. I can slant the text but the text is truncated > the above & below rows. How do I get slanted text? > >...

HTML to Plain Text corrected.
Somehow or another in MS Office Outlook 2007 (running on Vista Home Premium) I have managed to turn on a control/command that converts my HTML incoming email to Plain Text. It's the work of a second to right button it and specify "Display as HTML" but it seems so unneccessary to have to do that, more and more it seems. How do I get my received email to open in the same format as it was sent in, at least for HTML? Regards, Denzil. No need to repost. Your original question already got posted. Note that it could take several minutes before a post could show up. -- Robert Spa...

Outlook 2000 SP3
1. How to correct spelling of name left in brackets to indicate change in forwarded text? 2. Can I turn this off? Try again please. I'm sure there is a question in here somewhere. Provide sufficient detail for us to discern what it might be. Please keep in mind that we can't read your mind. -- Russ Valentine [MVP-Outlook] "ddddd" <ddddd@discussions.microsoft.com> wrote in message news:6041BFB2-A0DE-49DB-8FD4-009C8D02DDB9@microsoft.com... > 1. How to correct spelling of name left in brackets to indicate change > in > forwarded text? > 2. Can I t...

Text
I downloaded a report into excel. One of the columns are numbers but can't calculate them. How do I change it to a number? I don't want to use (example.. A1*1) -- Message posted from http://www.ExcelForum.com Copy an empty cell, select the import and do edit>paste special and select add If that doesn't work then you have invisible characters in the import -- Regards, Peo Sjoblom "MileHigh >" <<MileHigh.1053v9@excelforum-nospam.com> wrote in message news:MileHigh.1053v9@excelforum-nospam.com... > I downloaded a report into excel. One of the ...

can i convert numbers to written text in excell 2003?
Dear expert? i'd be very thankful and pleasured to have an answer to my mentioned question needless to say that i respect the others knowledgements and epertise. example for above: 25 should be written twenty five. See Bob's site http://www.xldynamic.com/source/xld.xlFAQ0004.html -- Regards Ron de Bruin http://www.rondebruin.nl "Ahmad Al-Nahar" <AhmadAlNahar@discussions.microsoft.com> wrote in message news:7271EF3D-1F18-44A8-9661-E181EF5225DA@microsoft.com... > Dear expert? > i'd be very thankful and pleasured to have an answer to my mentioned questi...

text in downward arc?
Hi there, using publisher i want to create text in a downward arc. i have tried to use the upward arc in the word art section and invert that but the text flips. i want to be able to read it from left to right. No matter how i try the text will not read from left to right? what am i doing wrong? Word art will do that. Which version of Publisher are you using? -- JoAnn Paules MVP Microsoft [Publisher] ~~~~~ How to ask a question http://support.microsoft.com/KB/555375 "ian cobbledick" <ian cobbledick@discussions.microsoft.com> wrote in message news:64D9450C-7416-453...

cannot read text message from incoming mail
I cannot read the incoming mail's text message. I only can read it when I press "reply", then i can read all my messages. ...

justified text alignment without hypens?
I want to use a justified text alignment in Publisher, but instead of streaching the line of text it uses hpyens? How do dI disable this feature? I don't want the hypens. Tools | Language | Hyphenation and uncheck automatically hyphenate ... -- Rae Drysdale "irish2mac" wrote: > I want to use a justified text alignment in Publisher, but instead of > streaching the line of text it uses hpyens? How do dI disable this feature? > I don't want the hypens. ...

Rich Text versus HTML format and attachments
1) Hi, I notice that if I use Rich Text as the format to send any files I attach are attached as an icon with the body of the message rather than when I use html as the format and they are attach under the Attach "section" below the Send line of the email. This messes with a user form I use to email as the icon messes up the format, etc. (in Rich Text). Is this normal? 2) I recently switched to Rich Text from html as default send format as I am led to believe that many large (fortune 500) corporations do not let HTML formatted emails through but automatically convert them to plain t...

Is it possible to Unicode only for menu text...
Hi i am working on application where i need menu text in Arabic. I have done it (VC++ 6)with the following method: I have added... Project-Settings-C++-Preprocessor definitions : _UNICODE & Project-Settings-Link-Category-OutPut : wWinMainCRTStartup Then i have write arabic text in menu enteries, it works fine. But in my application i an using lot of other data types like CString etc. These don't work if i not convert them in unicode. What i want to ask "is there is any way to unicode only the menu resouce not whole the application". Means i don't want t...

Paste Text
I often find the need to paste plain (un-formatted) text into a cell. To avoid pasting the formatting I have to: double-click (or F2) into the cell before I paste OR or Rght-Clk -> Paste Special -> Text Can I accomplish this w/ a single key stroke or toolbar click; i.e. paste plain text into the active/current cell w/o having to be in insert mode (F2). I tried to record a macro, but it appears the clipboard is emptied when you start recording because the Paste Special function is grayed out. Thanks Say we make the following macro: Sub oneshot() ActiveCell.PasteSpecial Paste:=xlPast...

How do I flip text?
Hello, How do I flip text? I would like to make t shirts but I need to flip the text so it doesn't show up backwards on the shirt. Thankyou I am using microsoft publisher 2000 "iworshipchocolate" wrote: > Hello, > > How do I flip text? I would like to make t shirts but I need to flip the > text so it doesn't show up backwards on the shirt. > > Thankyou If you use WordArt, it will mirror if you flip it without saving as a picture. If you need to use a text box then open help, input "mirror." -- Mary Sauer MS MVP http://office.microsof...

How to arabic text ...
Hi Could anybody please tell me about how to write arabic text in dialog box. I am using Win XP and VC++ 6. Mujtaba Get an arabic font, and set the dialogs right to left flag. AliR. "Mujtaba" <tomujtaba@hotmail.com> wrote in message news:8f4f92aa.0411300501.48ff50b1@posting.google.com... > Hi > > Could anybody please tell me about how to write arabic text in dialog > box. I am using Win XP and VC++ 6. > > Mujtaba Don't you also need to compile it with both _UNICODE and UNICODE defined so that you can get the Arabic characters to display properly o...

Advanced Find / Full-Text Index not working
Server: XCH 2k3 (w/o SP) / Win 2k3 Clients: Outlook 2003/2002 Advanced Find from client's Outlook returns no results using any criteria. Full-text Index working on defined schedule and mailbox store without Event log errors/warnings. Guidelines from "Best practices for deploying FTI" followed for FTI configuration. Strange: Microsoft Search and Gatherer Performance objects do not exist. Or, could this be language settings issue as described in Best practices...? Help? 1.) What is the query that is being sent and are you sure that there are messages that satisfy the req...

Text drawn upside down
Hi, I'm trying to play with OLE with Visual Studio 2005 and Windows Vista. I've done a MFC project which renders methematical equations from CStrings, and without any OLE stuff it works just fine. The formula is parsed, each symbol is put into a global in-memory object tree, objets are converted into CImages and then gradually mixed to obtain the final result by using BitBlt(). I've just used standard Win32 APIs like DrawText or LineTo. Now I'm trying to implement all the OLE stuff which would allow my application to be embedded in WordPad, for instance. Basically it w...

Scripting Full text Search
Hi Friends, SQL 2008 I need to be able to script the creating a full text index, in order to make it part of my deploy process to production. When I follow the wizard, there are not place to "script the changes" , what are my other options ? Thanks in advance, Pat On Mon, 12 Jul 2010 12:01:24 -0700 (PDT), Pat <patrickalexander.email@gmail.com> wrote: >Hi Friends, >SQL 2008 > >I need to be able to script the creating a full text index, in order >to make it part of my deploy process to production. >When I follow the wizard, there are not pl...

Using text in a cell in a formula
I need to have a formula use the text of adjacent cells to determine where to look for values. I want to grab data from multiple datasheets but I don't want to have to type the sheet name in every formula, I want the formula to grab the name of the sheet from an adjacent cell. i.e. I need a formula like =if(sheet1!B2>0,100,""), but I need a function that will fill in the sheet name from the text value of an adjacent cell that would have the sheet name in it as I will be doing this for multiple cells on the same sheet. see your other post -- Biff Microsoft...

Allowing text to overlap other cells
I have a cell that I want to display a wide line of text across several cells without expanding the size of the cell it is in. The cells to the right of it contain formulas. These cells will equal "" (blank) when I want to write across them. Scot, The line of text will NOT overlap the next cell if that cell contains anything even if that is a formula which return "". Only if that cell is really empty ( and "" is NOT empty) is will be "overlapped". -- Regards, Auk Ales * Please reply to this newsgroup only * * I will not react on unsolicited e...

Fitting Text in Quadrants
How can I setup text to fit in 4 quadrants on the same page? Desired Result: A | A A | A I want to have the same text fit in each quadrant and print the result on one 8 1/2 X 11 sheet of paper. These quadrants represent postcards. Thannks in advance. Page setup, postcards... In Publisher 2000 and below, page setup, special size, postcard -- Mary Sauer MS MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "razornt" <razornt@discussions.microsoft.com> wrote in message news:E716FC7A-CD8B-4103-B526-187E57DE0C03@microsoft.com... >...

Text on a CD Label
Does anyone know how to wrap text around the circumference of a CD label? In news:939b01c4862f$4e62cfe0$a501280a@phx.gbl, Tony <anonymous@discussions.microsoft.com> posted: || Does anyone know how to wrap text around the || circumference of a CD label? You would use WordArt. The object toolbar is along the left side of your screen. Choose WordArt, then on the WordArt toolbar, choose your shape, which would be the circular shape (not solid filled). -- Brian Kvalheim Microsoft Publisher MVP http://www.publishermvps.com ~pay it forward~ This posting is provided "AS IS" with...

Text in a Shape
I am using the Off Page Reference as a navigation means for users of a flow chart to go from one page to the correct next page. I have the hperlink in correctly but would like to embed some default text onto the shape (for example: DOUBLE CLICK TO CONTINUE) as I am able to do on other shapes. How can I accomplish this? Thank you Marsh On Wed, 13 Feb 2008 15:48:02 -0800, Marsh <Marsh@discussions.microsoft.com> wrote: >I am using the Off Page Reference as a navigation means for users of a flow >chart to go from one page to the correct next page. I have the hperlink in &...

Change valua into text ?
Hello Excellers, I wonder if it's possible to change a valua (1000) into text (THOUSAND) with a formula or VBA ? Is there anyone who can help me with this pls. Thanks Reijer Numbers to words Bob Phillips' site for help on this. http://www.xldynamic.com/source/xld.xlFAQ0004.html or Bernd Plumhoff's site http://www.sulprobil.com/html/spellnumber.html -------------------------------------------------------------------------------- -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email "Reijer" <dito2000@quicknet.nl> wrote in message new...

Receiving in Plain Text
I have tried to change to receive my e-mail in HTML format and the box to check is grayed out so I cannot choose it. Is there a way to change this. I have outlook 2002 Thanks MIke Are you using Word as the editor? What happens if you turn off Word? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without reading. After searching google.groups.com and finding no answer, Mike Shrout asked: | I have tried to change to receive my e-mail in...

text color
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) how do you change text color Search in the Word help for "text colour" On 23/05/10 10:10 AM, in article 59bb8dd8.-1@webcrossing.JaKIaxP2ac0, "aprilgsims@officeformac.com" <aprilgsims@officeformac.com> wrote: > Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) how do you change > text color -- The email below is my business email -- Please do not email me about forum matters unless I ask you to; or unless you intend to pay! John McGhie, Microsoft MVP (Word, Mac Word...

Limit input to Text Box
I want to limit the keys available to user to make input to a numeric field. I want to do this be traping the KEYDOWN event. If the user presses a key that I don't want them to use, how do I cancel the KEYDOWN? Do I set the keycode to false? "PosseJohn" <PosseJohn@discussions.microsoft.com> wrote in message news:C9585DF0-735B-47F9-A18F-8E6B647E95AD@microsoft.com... >I want to limit the keys available to user to make input to a numeric >field. > > I want to do this be traping the KEYDOWN event. > > If the user presses a key that I don&...