Help with If Not ... Is Nothing

kayza

Board Regular
Joined
Apr 29, 2015
Messages
61
Office Version
  1. 2007
Platform
  1. Windows
Hi
Since I am less so familiar with this statement, then I can not do much to do a series of tests with this statement. let's say there's a code like this

If Not X is Nothing Then

What does this code mean.
Is there anyone who can help me explain it, and give me a little example using this statement to better understand.

Thank you in advance
sorry if the thread has been discussed in this forum.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
It means basically:

If X has an Object assigned to it, then...

It is often used after a Find operation to check whether a value was found and the relevant cell was assigned to a variable.
 
Upvote 0
[FONT=&quot]X is going to be an object of some sort. One possiblity is X is going to be a [/FONT][FONT=&quot]range object (a range is a cell or group of cells on one sheet. Being that X [/FONT][FONT=&quot]is an object until it has been "Set" to something it will be "Nothing". Once [/FONT][FONT=&quot]it is set then it essentially points at a range. One common use for checking [/FONT][FONT=&quot]for nothing is when you do a "Find" operation. If nothing is found then the [/FONT][FONT=&quot]range object is still nothing. Now you check the X to determine if it is [/FONT][FONT=&quot]nothing, or if it points to the found cell.[/FONT]
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top