LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default ReDim string in loop

I am redimming an array in a loop. I do not know in before hand how many
times the loop will run. the array must have the siame size as the number of
iterations in the loop. My problem is that I ReDim the array using the number
of iterations as upper boundary. However I get the error message "index
outside of interval". I do not understand how this can happen. Perhaps
someone can help me? Any help is appeciated! Thanks very much in advance!

Do Until IsEmpty(rngSecID.Offset(r, lngTypeColumn))
ReDim strMaturityArray(0 To r)
If rngSecID.Offset(r, lngTypeColumn).Text = strGovBond Then
strMaturityArray(r) = Mid(rngSecID.Offset(r, 0), InStr(InStr(1,
rngSecID.Offset(r, 0), " ") + 1, rngSecID.Offset(r, 0), " ") + 1, 4)
MsgBox strMaturityArray(r)
End If
r = r + 1
Loop
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Do Loop or use End iF for search string RGreen Excel Discussion (Misc queries) 4 September 1st 09 12:59 AM
ReDim Array Viktor Ygdorff Excel Programming 2 July 10th 06 04:04 PM
Dim and Redim Sean Excel Programming 4 June 5th 06 07:31 PM
ReDim Problem Casey[_4_] Excel Programming 4 January 7th 04 10:41 PM
ReDim an Array Art[_5_] Excel Programming 3 October 25th 03 03:30 PM


All times are GMT +1. The time now is 09:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"