I decared it and gave it a value, but for certain loops I need it to be empty.
If I have
Dim somenumber As integer
somenumber = 5
'now I want to make it empty.
Thanks
I decared it and gave it a value, but for certain loops I need it to be empty.
If I have
Dim somenumber As integer
somenumber = 5
'now I want to make it empty.
Thanks
somenumber = 0
Not too sure what you mean by "empty", but you might use:
somenumber = vbNullString
or vbNullValue (I think there is such a thing ... see Help)
Sid
Why do you need the variable to be empty?
In fact why do you need it anyway.
Sid
I can't find a vbNullValue in the Object Browser or Help.
Did you?
For something as simple as this, I don't think reasons are required, just a solution. Wouldn't that be more productive?Originally Posted by Norie
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Malcolm
I sort of agree but I don't quite get what you mean by simplicity.
The OP has only posted this question, but they've not actually said what they actually want to do.
The original question could be addressed in several ways, including those suggested by yourself and others.