Compare cell value with string

  • Thread starter Shahriar Nour Khondokar
  • Start date
S

Shahriar Nour Khondokar

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top