Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Ayden Smith   on Feb 20 In MS Office Category.

  
Question Answered By: Nina Garcia   on Feb 20

OK, I can see a few things right away.
the "or" construct is expecting to compare two expressions that RESULT in true
or false.
So, the "or 511" is meaningless, or at least not what you're looking for.
Next, I wouldn't recommend "selecting" each cell. It causes WAY too much screen
updating.
What I would do is utilize the Value property as in c.Value
then, the Left function is going to return a character string, but you're
comparing it to a
numeric value, which can be unpredictable.
What you have to do is write  it like:
If ((Left(c.Value, 2) = "50") _
Or (Left(c.Value,2) = "511") _
Or (Left(c.Value,2) = "512") _
Or (Left(c.Value,2) = "531")) Then
I haven't had time to test  it, I'm kind-of in a rush...
hope this helps.

Share: 

 

This Question has 20 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on trouble with IF/OR, Left and a simple loop Or get search suggestion and latest updates.


Tagged: