Hello everyone,
I'm new to this forum, came to here because I have a problem with some code and it giving me a headache. Most frustrating part is probably because it's about something basic as defining an array and populating it. I'm just doing something wrong but can't see it.
Below is the code with explenation
At the start of the code, I define 2 dynamical arrays (no problem here). In the first array I store client information and in the second I store some figures relevant to the client.
Because I don't want the array to be empty, I fill in some data in the first line of both arrays. (Still no problem)
Now the part that give me a headache. The program I created will loop through a long list of data. Each line in the list, I have to check if client data (mentioned in 2 different columns) is already added to the array. If it is, I store the location in the array for fast access or add the client information to the array. The code below is the part where I compare data from the list with data in the array.
When running the script, it stops on the line I marked in bold and gives Runtime error 9, Subscript out of range error. But I suspect the cause of this error is in the line below. I've added the MsgBox line code to see if RotationArrayCount contains wrong information what would cause the error, but it's not the case. First time it contains 1 and second time it contains 2 and that is what it should be.
I hope you guys see what I fail to see.
Bookmarks