View Full Version : Assigning a null value to an Integer
robert32
01-18-2011, 06:00 AM
Hi,
I am looking to assign a null value to an integer. Would this code do it?
VarTypeThreshold4 = Null
Cheers,
Rob.
I do not believe you can. An Integer or Long are both initialized to zero. Also, I do not have a good explanation handy, but there is no reason to declare As Integer, just use Long.
Kenneth Hobs
01-18-2011, 06:38 AM
When you Dim it, it is set to a value of 0 or Empty. If you set equal to vbNull, the value is 1. Review help for VarType to see why.
The only way to get nothing is to not Dim it, do not use Option Explicit, and do not set it to any value. I find that poor practice myself.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.