Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
this seems like it should be easy, but a couple of things aren't working.
if you have declared an array: dim arParameters() as string and then later defined it: redim arParameters(1,2) as string how can you clear it out? Sort of like an UNdim ? Not just redefine it to another value, but put it back in the state it was in in the first place, right after the dim arParameters() as string ?? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
this seems like it should be easy, but a couple of things aren't working.
if you have declared an array: dim arParameters() as string and then later defined it: redim arParameters(1,2) as string how can you clear it out? Sort of like an UNdim ? Not just redefine it to another value, but put it back in the state it was in in the first place, right after the dim arParameters() as string Use the Erase statement... Erase arParameters You might want to look it up in the help files as it works "differently" for dynamic as opposed to fixed arrays and what happens depends on the data type of the array. Rick |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks!
I will look it up. 'Erase' ... almost like English. Thanks again. "Rick Rothstein (MVP - VB)" wrote: this seems like it should be easy, but a couple of things aren't working. if you have declared an array: dim arParameters() as string and then later defined it: redim arParameters(1,2) as string how can you clear it out? Sort of like an UNdim ? Not just redefine it to another value, but put it back in the state it was in in the first place, right after the dim arParameters() as string Use the Erase statement... Erase arParameters You might want to look it up in the help files as it works "differently" for dynamic as opposed to fixed arrays and what happens depends on the data type of the array. Rick |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Erase arParameters
Alan Beban mark wrote: this seems like it should be easy, but a couple of things aren't working. if you have declared an array: dim arParameters() as string and then later defined it: redim arParameters(1,2) as string how can you clear it out? Sort of like an UNdim ? Not just redefine it to another value, but put it back in the state it was in in the first place, right after the dim arParameters() as string ?? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, Rick, that worked fine.
The problem I was having was that two variables that I thought would be totally out of scope and gone away when the code terminated, did not. But, I've reset the one in the code now, and the Erase statement that you suggested has taken care of that. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks. got it. it works for what I need.
"Alan Beban" wrote: Erase arParameters |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Clearing cells without clearing formulas | Excel Discussion (Misc queries) | |||
Clearing Array Contents | Excel Programming | |||
Array for clearing checkboxes | Excel Programming | |||
clearing array contents | Excel Programming | |||
vba clearing out values stored in array | Excel Programming |