Re: Text as argument to Randomize function
- From: "Ralph" <nt_consulting64@xxxxxxxxx>
- Date: Sun, 27 Apr 2008 20:04:18 -0500
"johngross" <johngross@xxxxxxxxxxxxxxx> wrote in message
news:66cf83d0-e423-4cc2-bf20-af067a68e261@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I would like to be able to use text (as a string) as the argument for
the Randomize function.
The VBA Help says that the argument is of type Variant, which - as I
understand it - includes strings. I'e tried to do this in various
ways, but none of them seems to work; the closest I get is when an
error message tells me that an argument of this type must be in an
object module.
Is what I want to do possible?
If so, can anyone point me in the direction of how to do it?
Regards to all,
johngross
The documentation is a bit confusing here .. the argument can be "a Variant"
as long as that Variant evalutes to a "valid numeric expression".
If you have a String value that represents a number (eg, "00345", "123",
"23.5", ...) then use a Conversion function on it such as CLng(StringValue)
or CDbl() depending on scope.
If you are using a string such as "abcde" then you will need to run some
kind of hash on it to turn it into a number. (But my guess is you have the
former.)
-ralph
.
- References:
- Text as argument to Randomize function
- From: johngross
- Text as argument to Randomize function
- Prev by Date: Re: QUESTION: Jet Engine Database Sizes???
- Next by Date: Re: Text as argument to Randomize function
- Previous by thread: Text as argument to Randomize function
- Next by thread: Re: Text as argument to Randomize function
- Index(es):
Relevant Pages
|