Search : in
By :

Help to check if else statements

Last answer on Jul 7, 2009 3:23:04 am BST Rosi, on Jul 6, 2009 3:57:55 pm BST 
 Report this message to moderators

Hello,
I want to declare a name for the cell B25 from worksheet2. Let's call it "The Error".
Then, I want to check several statements to check "The Error" values.
For example, If "The Error" >= 1 and "The Error" <10
Message "Green range"
ElseIf "The Error" >=11 and "The Error" <15
Message "Red range"
Else
Message "Invalid"
End

Using Excel 2003, VBA

Configuration: Windows XP Internet Explorer 6.0

Best answers for « help to check if else statements » in :
[Linux] Check if your CD has been successfully burned Show[Linux] Check if your CD has been successfully burned Intro Notes Implementation Intro Under Linux there is a small utility that allows you directly to verify file integrity by comparison. It is call md5sum that calculates the...
How can I check if my antivirus is active? ShowHow can I check if my antivirus is active? The test If you have any doubts about whether your antivirus is active or not, you can simply download the following file: http://www.eicar.org/download/eicar_com.zip If your...
[Windows 7] Check if your PC is infected. Show[Windows 7] Check if your PC is infected A simple method to find out if your PC is infected or not: Go to the Start menu, open the Run tab and type the system.ini, confirm by clicking OK. A window will open: If you have the...
Download MP3-Check ShowFormat MP3 is audio format par excellence for audio compression. But it is really possible that there are errors in formats, notably graffiti there. MP3-Check is an application which allows to prove your music collection for quality and possible...
Network tests and diagnostics ShowTesting the IP configuration Before doing anything else, you are advised to check the computer's IP configuration. Windows systems offer a command-line tool, called ipconfig, that lets you find out your computer's IP configuration. The output of...
Ping ShowThe Ping tool "Ping" (short for Packet INternet Groper) is without a doubt the best-known network administration tool. It is one of the simplest tools, because all it does is send packets to check if a remote machine is responding and, by...
Installing a network card ShowGoal The goal is to set up a network in order to exchange data or play games on the network. Thus, it is necessary to install a network card on every computer that may become part of the LAN. The purpose of this tutorial is to help you to install a...

1

 venkat1926, on Jul 7, 2009 3:23:04 am BST

Try this
the range name should be one word so use "the_error"

Sub test()
Dim rng As Range
Set rng = Range("the_error")
If rng >= 1 And rng < 10 Then
MsgBox "green range"
ElseIf rng >= 11 And rng < 16 Then
MsgBox "red range"
Else
MsgBox "invalid"
End If
End Sub

Reply to venkat1926