PC Review


Reply
Thread Tools Rate Thread

Compare cell value with string

 
 
Shahriar Nour Khondokar
Guest
Posts: n/a
 
      30th May 2009
Hi all
I am trying to compare (and identify) the values in a column with 2 strings.
i am using the following code:
If (Cells(loop_counter, "B").Value = "Software:Internal" Or
Cells(loop_counter, "B").Value = "Software:Test Fixed Fee") Then

....
End If
'loop_counter' is a variable that has been declared.
This piece of code does its job and identifies cell in column-B that have
"Software:Internal" and "Software:Test Fixed Fee" as value.

But when i try to use the code below to identify the cells that do NOT have
"Software:Internal" and "Software:Test Fixed Fee" as Value, it is not working:
If (Cells(loop_counter, "B").Value <> "Software:Internal" Or
Cells(loop_counter, "B").Value <> "Software:Test Fixed Fee") Then

....
End If

Can someone please help me understand why is this not working and what can i
use to get the desired result?

Thanks for you help.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FIND / SEARCH text compare cell to string in 3rd cell =?Utf-8?B?bmFzdGVjaA==?= Microsoft Excel Misc 0 29th Oct 2007 02:51 AM
Compare text string of a cell in Column A VS another cell in Colum =?Utf-8?B?VGFu?= Microsoft Excel New Users 2 1st Aug 2007 09:45 AM
Compare text string of a cell in Column A VS another cell in Colum =?Utf-8?B?VGFu?= Microsoft Excel Misc 1 1st Aug 2007 09:03 AM
Compare text string of a cell in Column A VS another cell in Colum =?Utf-8?B?VGFu?= Microsoft Excel Worksheet Functions 1 1st Aug 2007 09:01 AM
Compare text string of a cell in Column A VS another cell in Colum =?Utf-8?B?VGFu?= Microsoft Excel Programming 0 30th Jul 2007 05:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:33 PM.