You will need to use type "Variant" to convert from one type to another, as needed. This is easy but variants are less efficient than the other data types; they require more memory and operate less quickly than other data types.
Dim variableName As Variant
If I were you, and you can code like this, I would use different variables for different things (keeping numbers and letters in different variables) because this will give you much less of a headache in the long run.
2006-10-13 06:07:32
·
answer #1
·
answered by jasonstroble 3
·
2⤊
1⤋
With all due respect to a previous answer - you should avoid using variant variables. By default, visual basic handles undeclared variables as variant data types - and attempts to convert them at run time to the appropriate data type. In simple programs, this isn't usually a problem. However, in more complex applications where speed is a concern - the extra steps of converting variant data types can be problematic.
Variant data types should only be used when you (the programmer) have no idea as to what type of data the variable will be asked to handle.
For mixed variable data - numeric and text (string) - use the string data type. There are simple routines to parse the string into numbers or text - depending upon what you're actually trying to accomplish.
Good luck!
2006-10-13 09:24:20
·
answer #2
·
answered by SquirrelNutz 4
·
1⤊
0⤋
How could you use alphabets to make calculations? In the end they should be converted to a integer ou float-point variable type, shouldn't be?
Anyway, if you are in doubt, follow the advice the guy upside told you, variant...
2006-10-13 06:18:59
·
answer #3
·
answered by Itamar R 5
·
0⤊
0⤋
You should use string type of variable to work with both numeric and alphabet
2006-10-13 06:01:41
·
answer #4
·
answered by Kugan S 1
·
1⤊
1⤋
seen difficulty-unfastened 6.0 permits you to create purposes, seen Studio is an completely diverse product. As for a unfastened acquire, the utility continues to be below Microsoft's copyright which might make it infringement. purely purchase a duplicate, I advantageous somebody sells it.
2016-10-02 06:32:41
·
answer #5
·
answered by ? 4
·
0⤊
0⤋