Invalid next control variable reference ошибка vba

Обновлено: 07.07.2024

The numeric variable in the Next part of a For. Next loop must match the variable in the For part. This error has the following cause and solution:

The variable in the Next part of a For. Next loop differs from the variable in the For part. For example:

Check the spelling of the variable in the Next part to be sure it matches the For part. Also, be sure you haven't inadvertently deleted parts of the enclosing loop that used the variable.

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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.

Числовая переменная в части Next цикла For. Next должна совпадать с переменной в части For. Эта ошибка имеет следующие причину и решение:

Переменная в части Next цикла For. Next отличается от переменной в части For. Например:

Проверьте орфографию переменной в части Next, чтобы убедиться, что она соответствует части For. Также проверьте, чтобы случайно не были удалены части объемлющего цикла, в котором используется переменная.

Для получения дополнительной информации выберите необходимый элемент и нажмите клавишу F1 (для Windows) или HELP (для Macintosh).

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

Есть вопросы или отзывы, касающиеся Office VBA или этой статьи? Руководство по другим способам получения поддержки и отправки отзывов см. в статье Поддержка Office VBA и обратная связь.

The numeric variable in the Next part of a For. Next loop must match the variable in the For part. This error has the following cause and solution:

The variable in the Next part of a For. Next loop differs from the variable in the For part. For example:

Check the spelling of the variable in the Next part to be sure it matches the For part. Also, be sure you haven't inadvertently deleted parts of the enclosing loop that used the variable.

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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.

After editing my code, i am getting an invalid next control variable reference. Is anyone able to provide an explanation of what is causing this issue? the reason for the order of my loop is because i'd like to first check all columns of a row then all move onto the new row before looking for a new match

Starting point

the information i want to grab

I want to grab information from column B (second picture) and the column name in which the dates match Column K from the first picture.

Читайте также: