I told you there were errors in the code. I left them in there. And you found one. Now you need to fix it. I don't mind helping you. But I just felt that your friend should do some of the work. Nevertheless, WaltP has graciously pointed out the error for you in line 28 which is listed quite clearly in a previous post as the following (see line 28 in previous post):
Line Input #lngFileEngland, strArray(intCounter)
By the way, did I say that was line 28?
I threw away the code here. Don't need it. But what I had originally considered was storing each line in an array of string: Dim strArray(7) as String. That way you could save each line in the array for future reference within the function. But after seeing the code in action, I determined I didn't need an array. So I removed the array changing strArray(7) to just strArray. Hence, the error I knew would arise, if you tried to run the code as is. Apparently, not only does your friend in Sweden have VB6, you must have Visual Basic also.
At first the original code contained a fixed array of strings ( strArray(7) ) that would hold the days of the week as they were being loaded inside theDo Loop. Since VB6 arrays are by default zero based--meaning the first index starts with 0--this will actually give you 8 days. So, technically you could use strArray(6) and have 7 String variables to use this function.
I did not include code to figure what to do with Greece. I felt your friend should do some work. Nevertheless, WaltP has helped your friend find the error I left in on purpose. And now he has less work to do.
But you'll notice how the declarations for strings, integers, long variables were declared.
I learned this from style from a PDF written in Spanish from a teacher in Mexico. I later learned the same style from a Mastering Visual Basic CD put out by the creators of Visual Basic who more than likely reside in the United States on the West Coast. I have seen similar style used by programmers in Europe. Just thought I would pass along what I thought were good habits taught by established programmers in their profession.
But it helps you to identify what type of variable is being used in your code.
It's good coding practice to set a standard and keep it consistent when writing code.
I just want to encourage him to use good coding practices.
str --> String
lng --> Long
int --> Integer
But by using a consistent style, you can help yourself and others down the road, if others have to read your code.
Your friend was using str at the beginning of a variable that was a Long, i at the beginning of a String Variable. So, personally, I thought that was confusing.
But this is just what I believe good VB programmers typically recommend. C programmers have their own idiosyncrasies for declaring variables. But this is just my opinion. Take it for what it's worth.
But then again. I have only received this recommendation from Microsoft's authors and from a teacher in a school system who was taught by other teachers. Maybe I should consult with somebody with a better background?