Nucleus,
I wasn't saying that another data type should be used instead of Long. I was just saying that the Int function is a little quicker than the CLng function when you're trying to get a whole number. I'm talking about two functions, not data types.
Long is certainly the fastest datatype and I use it all the time.
OK, now I see what you were saying, my mistake. Just out of interest do you know of a reference to point out the relative speeds of all functions, or does it just come through testing yourself?
Also you know that thread about preventing pasting, well I have been fiddling around with a class to validate text boxes, and it seems to stop pasting even though the code has not been developed to do that yet, which is frustrating as I would like to preserve the ability to paste and optionally turn it off.
Anyway you might be interested in taking a peek and see what you think.
Nucleus,
I found out about Int being quicker because I read it someplace a long time ago. I don't remember where. Since then, I've also tested it out. I guess the easiest way of comparing function speeds is through testing.
The reason why pasting doesn't work in your class module is because you're setting KeyAscii to zero if it's 22, the ascii code for ^V, or Ctrl+V. I usually allow anything under 32 in the KeyPress event to prevent problems like this.
That's a pretty good idea, using a class module to easily apply the code to different textboxes.