This error occurs when the same variable is used as the counter argument in one FOR...NEXT statement and in a nested FOR...NEXT statement inside that loop. Nested FOR...NEXT statements must use diffrent variables for their counter arguments.