datatypes RRS feed

  • Question

  • 1)what is a variant. what the pros and cons of its ues in VBA Code practically?



    Thursday, August 6, 2015 3:41 AM

All replies

  • Hi,

    for the first step, Google/MSDN can help: MSDN Variant

    A variable with the datatype variant can store every type of data. So it doesn't matter which content you will assign to this variable.

    It's an easy and fast way to use variables, but only if it will be used in a small scope.

    As a big con you can't trust the content of this variable and it is necessary to ensure that you next command (where you use the variable content) will work with the stored datatype.

    Use it if you test something, use it not or rarely if the code is in use for a long time.

    Best regards

    • Proposed as answer by André Santo Thursday, August 6, 2015 12:29 PM
    Thursday, August 6, 2015 5:56 AM