Thread: IF NOT
View Single Post
  #3   Report Post  
Nick
 
Posts: n/a
Default

I have looked at the site and nothing seems to work or be useful. I'm working
in Visual basic within a long macro. Anyone got any tips on the code to
possibly use. At the moment I have

If Range("B12") = "1" or "2" or "3" Then
Range("A1").Select
Else If Range("B12") Is Not "1" or "2" or "3" Then
MsgBox "Re-enter Number"

An error message is displayed saying Compile error: Type Mismatch

Any ideas people

"Andy B" wrote:

Hi

I would suggest having a look at Data|Validation. It will do just what you
want!
Have a look he http://www.contextures.com/xlDataVal01.html for more
information and examples.

--
Andy.


"Nick" wrote in message
...
I am having a little difficulty trying to write a formula to display a
message if a certain cell does not contain the correct information. Can
anyone please help me with this.

I.e. If cell A1 does not contain 1 or 2 or 3 then display message "reenter
number"

Cheers