LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Assign Values to array

The OP was asking (at least the way I read the question(!)) why I used:

Dim V as Variant
instead of
Dim V() as Long 'or variant or whatever.

This explanation:

This is because with the syntax shown, you are assigning an array directly
to a dynamically declared array... the ability to do this was added in
Version 6 of VB/VBA.


seem to disagree with this earlier statement:

The Array function requires it. That is because you can put almost anything
in the argument list to the Array function, as long as you remember what is
what, of course.<g For example...



"Rick Rothstein (MVP - VB)" wrote:

<<snipped
But my real point to the OP was that some versions allow this syntax:

dim V() as variant
v = array(1,2,"A")

and some versions don't allow it.


This is because with the syntax shown, you are assigning an array directly
to a dynamically declared array... the ability to do this was added in
Version 6 of VB/VBA.

Rick


--

Dave Peterson
 
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
How would I attach or assign values to a trendline? williamk2v Excel Worksheet Functions 4 July 4th 08 09:22 PM
Assign Cell Values without a Loop BHatMJ Excel Discussion (Misc queries) 4 May 29th 08 04:26 PM
Array: Counting multiple values within array Trilux_nogo Excel Worksheet Functions 4 April 16th 07 03:12 AM
Assign values to text Town of Exeter Excel Worksheet Functions 0 August 17th 05 01:47 PM
In Excel how can I assign values to a Yes or No question with IF craigscoop Excel Discussion (Misc queries) 5 July 1st 05 12:44 AM


All times are GMT +1. The time now is 08:27 AM.

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"