Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Running Windows XP and Office XP.
I am trying to store data returned from a search into a dynamic multidimensional array with the following code, If currentCell.Value Like searchText Then i = i + 1 ReDim Preserve searchResults(i, 4) searchResults(i, 1) = ActiveSheet.Name searchResults(i, 2) = currentCell.Value searchResults(i, 3) = descriptionCell.Value searchResults(i, 4) = priceCell.Value End If having declared the array at the top of the procedure with Dim searchResults() As Variant Problem is that the code always halts with a "subscript out of range" error message when i = 2. If I remove the Preserve then the code runs fine except I only have the last line of search data. Any ideas anybody? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA syntax help: ReDim Preserve an array | Excel Discussion (Misc queries) | |||
Declare Multidimensional Arrays | Excel Programming | |||
Declare Multidimensional Arrays | Excel Programming | |||
Multidimensional Arrays - VBA | Excel Programming | |||
Multidimensional Arrays - VBA | Excel Programming |