Hi,
but i just get this error every time ??
Let's look at this line of code:
It's sitting inside a sequence of If...End If blocks, which means that it will only be called when certain conditions are met.
families is a dynamic array. If the ReDim statement isn't called then families is not dimensioned. If it isn't dimensioned then you can't use a For Each... Next loop to iterate through it, so you get that "For Loop Not Initialized" runtime error. Here is a simple example to illustrate:
So, you essentially have two options to fix the problem. You could either restructure your code to ensure ReDim is called, or you could devise a test to ensure that the array has been dimensioned. (larger code re-write or errorhandling are also options).
Bookmarks