for control variable already in use

Когда вы вложены в. Next в каждом цикле необходимо использовать разные управляющиепеременные . When you nest For. Next loops, you must use different controlvariables in each one. Эта ошибка имеет следующие причину и решение: This error has the following cause and solution:

  • Во внутреннем цикле for используется тот же счетчик, что и во вложенном цикле for . An inner For loop uses the same counter as an enclosing For loop. Проверьте вложенные циклы на повторы. Check nested loops for repetition. Например, если внешний цикл использует For Count = 1 To 25 , внутренние циклы не могут использоваться Count в качестве переменных управления. For example, if the outer loop uses For Count = 1 To 25 , the inner loops can’t use Count as the control variables.

Для получения дополнительной информации выберите необходимый элемент и нажмите клавишу F1 (для Windows) или HELP (для Macintosh). For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).

Поддержка и обратная связь Support and feedback

Есть вопросы или отзывы, касающиеся Office VBA или этой статьи? Have questions or feedback about Office VBA or this documentation? Руководство по другим способам получения поддержки и отправки отзывов см. в статье Поддержка Office VBA и обратная связь. Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.

When i try debugging this code, i am getting two errors, the first one saying «For control variable already in use», and the second one «Expected end Sub». the goal of my code is that i created series of checks in my sheet «poteaux» and i want to take values from the sheet «Efforts poteaux» and put them in certain cells in poteaux so that the formulas will be checked. The msg box gives me if it’s good or not. i am new to vba and im giving it a try.

For control variable already in use

When you nest For. Next loops, you must use different controlvariables in each one. This error has the following cause and solution:

  • An inner For loop uses the same counter as an enclosing For loop. Check nested loops for repetition. For example, if the outer loop uses For Count = 1 To 25 , the inner loops can’t use Count as the control variables.

For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).

Оцените статью
SoftLast
Добавить комментарий