Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What does it mean when you have a variable with parens? Like declaring v() as
Variant, and then using the variable v with another variable it seems right beside it, like v(i)? Can anyone help? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What you are describing is a Dynamic Array.
Search Excel Help for this: declaring arrays Post back with any questions. *********** Regards, Ron XL2002, WinXP-Pro "Mike" wrote: What does it mean when you have a variable with parens? Like declaring v() as Variant, and then using the variable v with another variable it seems right beside it, like v(i)? Can anyone help? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The brackes denote an array. An array is a collection of like varaibles, for
example: dim aryMyIntegers(10) as integer declares an array of 10 integers. The line aryMyIntegers(3) references the 4th element of the array since the numbering starts at zero. -- HTH... Jim Thomlinson "Mike" wrote: What does it mean when you have a variable with parens? Like declaring v() as Variant, and then using the variable v with another variable it seems right beside it, like v(i)? Can anyone help? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
So what does it mean when you declare it with empty brackets? ()
"Jim Thomlinson" wrote: The brackes denote an array. An array is a collection of like varaibles, for example: dim aryMyIntegers(10) as integer declares an array of 10 integers. The line aryMyIntegers(3) references the 4th element of the array since the numbering starts at zero. -- HTH... Jim Thomlinson "Mike" wrote: What does it mean when you have a variable with parens? Like declaring v() as Variant, and then using the variable v with another variable it seems right beside it, like v(i)? Can anyone help? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
OK, Mike
Copied from Excel Help: ------------------------------ Declaring a Dynamic Array By declaring a dynamic array, you can size the array while the code is running. Use a Static, Dim, Private, or Public statement to declare an array, leaving the parentheses empty, as shown in the following example. Dim sngArray() As Single Note You can use the ReDim statement to declare an array implicitly within a procedure. Be careful not to misspell the name of the array when you use the ReDim statement. Even if the Option Explicit statement is included in the module, a second array will be created. In a procedure within the array's scope, use the ReDim statement to change the number of dimensions, to define the number of elements, and to define the upper and lower bounds for each dimension. You can use the ReDim statement to change the dynamic array as often as necessary. However, each time you do this, the existing values in the array are lost. Use ReDim Preserve to expand an array while preserving existing values in the array. For example, the following statement enlarges the array varArray by 10 elements without losing the current values of the original elements. ReDim Preserve varArray(UBound(varArray) + 10) Note When you use the Preserve keyword with a dynamic array, you can change only the upper bound of the last dimension, but you can't change the number of dimensions. ------------------------------ *********** Regards, Ron XL2002, WinXP-Pro "Mike" wrote: So what does it mean when you declare it with empty brackets? () "Jim Thomlinson" wrote: The brackes denote an array. An array is a collection of like varaibles, for example: dim aryMyIntegers(10) as integer declares an array of 10 integers. The line aryMyIntegers(3) references the 4th element of the array since the numbering starts at zero. -- HTH... Jim Thomlinson "Mike" wrote: What does it mean when you have a variable with parens? Like declaring v() as Variant, and then using the variable v with another variable it seems right beside it, like v(i)? Can anyone help? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Runtime Error '91' Object variable or With block variable not set | Excel Discussion (Misc queries) | |||
variable height variable width stacked bar charts | Charts and Charting in Excel | |||
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? | Excel Worksheet Functions | |||
Run-time error '91': "Object variable or With block variable not set | Excel Programming | |||
Cells.Find error Object variable or With block variable not set | Excel Programming |