PDA

View Full Version : Solved: resetting a variable to empty



mferrisi
04-05-2007, 11:40 AM
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

Bob Phillips
04-05-2007, 11:43 AM
somenumber = 0

Cyberdude
04-06-2007, 11:39 AM
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

Norie
04-06-2007, 12:07 PM
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.:bug:

Did you?

mdmackillop
04-06-2007, 12:55 PM
Why do you need the variable to be empty?

In fact why do you need it anyway.
For something as simple as this, I don't think reasons are required, just a solution. Wouldn't that be more productive?

Norie
04-06-2007, 02:05 PM
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.