Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
I have a macro that I run am running - here is the problem. I have an array of values that is populated in the macro. It is a public variable and I cannot make it local. When I rerun the array keeps its old values. Question - is there anyway to zero out the array again - I was just using the loop at the beginning of the macro For i =1 to 100 array(i) =0 Next i .... but is there a better way? Thanks for your help |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Erase ArrayName
-- Jim "Jeff" wrote in message ... | Hi, | | I have a macro that I run am running - here is the problem. | | I have an array of values that is populated in the macro. It is a public | variable and I cannot make it local. When I rerun the array keeps its old | values. | | Question - is there anyway to zero out the array again - I was just using | the loop at the beginning of the macro | For i =1 to 100 | array(i) =0 | Next i | | ... but is there a better way? | | Thanks for your help |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Maybe using Erase would work for you:
Dim myArray(1 To 100) As Long Dim iCtr As Long For iCtr = LBound(myArray) To UBound(myArray) myArray(iCtr) = iCtr Next iCtr Erase myArray Jeff wrote: Hi, I have a macro that I run am running - here is the problem. I have an array of values that is populated in the macro. It is a public variable and I cannot make it local. When I rerun the array keeps its old values. Question - is there anyway to zero out the array again - I was just using the loop at the beginning of the macro For i =1 to 100 array(i) =0 Next i ... but is there a better way? Thanks for your help -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
any free add-ins? | Excel Discussion (Misc queries) | |||
any free add-ins? | Excel Worksheet Functions | |||
Free HP Notebook | Excel Discussion (Misc queries) | |||
Are there any free XL widgets out there ... | Excel Discussion (Misc queries) | |||
Free Add Ins for Excel?? | Excel Discussion (Misc queries) |