Okay, I think I know what you mean. To paraphrase:
You want to be able to dynamically assign the names and types of variables during run-time, at the users request.
So if the user said they wanted to dim a string with the value "Hello World", they would click teh relevant buttons on your form, and that would then be instantiated as a variable.
I think thats right, let me know if not.
Now, as I understand it, you cannot dimension variables at run time. At compile time, VBA will throw up errors because it simply does not know what the value of any proposed variables are (or their names or types).
There is one way that I would consider getting round this.
I would create a variant array of a pre-defined datatype that I had created to simulate what you are after. For example:
Code:
private type UserDataType
variable_type as String
variable_value as Variant
end type
dim simulated_array(1000) as UserDataType
So here, there is an array with 1000 possible entries, each of the type 'UserDataType'. As a user selects a variable that they want to create (say a String of "Hello World", and an Integer of 306) you can access the next empty point in the array and assign the variable_type to "Integer", or "String", and then assign the variant variable_value to "Hello World" or 306.
Hope this makes sense as some sort of a solution for you
Patrick