User defined data type

G

Guest

hi

Is it possible to create a user-defined data type of the following example

11.1 (ie, the data type must be within 99.9 to 00.0

I know I could use a For...Next to validate a input (say A1), or If Statement, but wouldn't be far more efficient if I could use VarType function

Also could someone tell me, why is it that when I test the following code in Immediate Window in VBE
a=11.
b=TypeName(a
print

I get b as Double, why is it that it ain't in Single?
 
T

Tom Ogilvy

A data type does not support limiting the values it can hold beyond storage
restrictions on the size of a value it can store. UDT's are made up of
standard data types.

As to the immediate window, what real diffence does it make. The immediate
window is for debugging. You can use implicit declarations if you need a
specific type.

--
Regards,
Tom Ogilvy

augustus108 said:
hi,

Is it possible to create a user-defined data type of the following example:

11.1 (ie, the data type must be within 99.9 to 00.0)

I know I could use a For...Next to validate a input (say A1), or If
Statement, but wouldn't be far more efficient if I could use VarType
function?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top