Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all. Over the last month or so, I have familliarized myself (almost
painfully so) with utilizing arrays and loops together in my macros for efficiency (and sanity). What I am wondering, is how do you load an array dynamically? I know well how to declare one such as V = Array("stuff","morestuff") etc etc However what if the contents of the array need to change on a weeky basis? I hate having to go in and reprogram it, and was wondering if there was a way to load it dynamically? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe soimething like
ReDim Preserve ary(UBound(ary) + 1) ary(UBound(ary)) = "xyz" -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "havocdragon" wrote in message ... Hi all. Over the last month or so, I have familliarized myself (almost painfully so) with utilizing arrays and loops together in my macros for efficiency (and sanity). What I am wondering, is how do you load an array dynamically? I know well how to declare one such as V = Array("stuff","morestuff") etc etc However what if the contents of the array need to change on a weeky basis? I hate having to go in and reprogram it, and was wondering if there was a way to load it dynamically? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() havocdragon wrote: Hi all. Over the last month or so, I have familliarized myself (almost painfully so) with utilizing arrays and loops together in my macros for efficiency (and sanity). What I am wondering, is how do you load an array dynamically? I know well how to declare one such as V = Array("stuff","morestuff") etc etc However what if the contents of the array need to change on a weeky basis? I hate having to go in and reprogram it, and was wondering if there was a way to load it dynamically? You may want to declare the array as opposed to using the array function. Without clarification it is unclear what you want to do. Here is a sub that loads an array with the weeks dates starting with today. Sub ldarray() Dim myarray(1 To 7) As Variant Dim c As Variant Dim i As Integer c = Now() For i = 0 To 6 myarray(i + 1) = Format(c + i, "mm/dd/yyyy") Next End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dynamically load DataValidation List through Source field? | Excel Worksheet Functions | |||
load addresses of selected cells into array | Excel Programming | |||
Load a static array at procedure level | Excel Programming | |||
Load excel range into multi dimensional array | Excel Programming | |||
Load an array with Sheet names | Excel Programming |