> | How do I check for spaces in a string variable? Nothing but spaces
or
| nothing.
| I am using
| if trim(x) = "" then
| which works but I was wondering if there was a cleaner way to do it.
|
| I prefer not using variant variables.
|
| Thank you
| Smokey
As already said, that's pretty clean.
I would use
If Len(Trim(X)) = 0 Then
just because - um, I guess because it makes more sense to me.
It is also faster than comparing String values directly (although I
would still throw the $ sign on the end of the Trim keyword in order to
force the Trim function to return a String value directly (otherwise,
without the $ sign, Trim returns a Variant with a sub-type of String).
Rick - MVP