ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Variant (https://www.excelbanter.com/excel-programming/342819-variant.html)

owl527[_5_]

Variant
 

Hi,
could you please let me know what the following means?
Dim szWarData() As Variant

ReDim szWarData(ntRow + 1, 10)

What does Variant mean?

Please let me know. Thanks

--
owl52
-----------------------------------------------------------------------
owl527's Profile: http://www.excelforum.com/member.php...fo&userid=2091
View this thread: http://www.excelforum.com/showthread.php?threadid=47618


JakeyC

Variant
 
A 'Variant' is a type of variable declaration just like 'Integer' or
'String'. The difference is that a variant may store data of an
unspecified format i.e. not just whole numbers or not just a block of
text.


baj

Variant
 
In fact you can't compare a Variant just with an Integer or a String...

OK, it stands also for a specific type, the "Variant"-type but that's
just the thing : if you don't know exactly what type you need you can
just take the Variant as a black box... the Variant has a big fitt for
all kinds of variables, but at the same time you have to be carefull
with it...

In your example : Dim szWarData() As Variant
szWarData() is in fact the definition of a dynamic array (meaning it's
not fixed, it can be changed) of the Variant type (note: if you don't
define the type exactly, the system assumes it's a Variant-type)

Now in you next statement : ReDim szWarData(ntRow + 1, 10)
you give the variable szWarData the dimensions ntRow+1 and 10...

To learn more about this you should look into the subjects : Arrays,
Dynamic Arrays, Redim, Erase, UBound and LBound...

Good Luck



All times are GMT +1. The time now is 12:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com