#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
baj baj is offline
external usenet poster
 
Posts: 24
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
using find with variant? Don S Excel Programming 4 August 16th 05 04:52 PM
Find Variant StephanieH Excel Programming 7 February 23rd 05 03:48 PM
Variant as matrix curious Excel Programming 5 June 2nd 04 04:18 PM
Variant Array Steph[_3_] Excel Programming 1 June 2nd 04 01:29 AM
Variant to String Chip Pearson Excel Programming 1 September 3rd 03 03:10 PM


All times are GMT +1. The time now is 07:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"