K
kate.maunder
Hi,
I've been helping write some VBA code which is executed from a button
on an excel worksheet. Data is read in from the sheet, calculations
are performed in multiple modules (public variables). The problem is
that as some of the arrays which hold the data are dimensioned using
Redim Preserve, which means that when the program ends, the data is
still in the arrays.
If the program is run a 2nd time from the button on the worksheet,
lots of errors are generated in the program, as the arrays are full of
data from the first run. If "reset" is clicked in the VB editor, the
arrays empty & the code runs fine. Is there a way to code this
'reset' button & empty the arrays?
Cheers,
Kate
I've been helping write some VBA code which is executed from a button
on an excel worksheet. Data is read in from the sheet, calculations
are performed in multiple modules (public variables). The problem is
that as some of the arrays which hold the data are dimensioned using
Redim Preserve, which means that when the program ends, the data is
still in the arrays.
If the program is run a 2nd time from the button on the worksheet,
lots of errors are generated in the program, as the arrays are full of
data from the first run. If "reset" is clicked in the VB editor, the
arrays empty & the code runs fine. Is there a way to code this
'reset' button & empty the arrays?
Cheers,
Kate