Управление макросами functions

[ ] indicates optional parameters

АРГУМЕНТ([строка_имени], [номер_типа_данных], [ссылка])
ВОЗВРАТ([значение])
ДЛЯ(имя_счетчика, нач_ном, кон_число, [шаг_ном])
ДЛЯ.ЯЧЕЙКИ(ссылка_на_имя, [ссылка_на_область], [проп_пустые])
ЕСЛИ(логическое_выражение)
ЖДАТЬ([дата_как_число])
ИНАЧЕ()
ИНАЧЕ.ЕСЛИ(логическое_выражение)
КОН.ЕСЛИ()
НАЧСНОВА([номер_уровня])
ПЕРЕЙТИ(ссылка)
ПЕРЕСЧИТЫВАЕМАЯ([флаг])
ПОКА(лог_выражение)
ПРЕКР()
РЕЗУЛЬТ([ном_типа])
СЛЕД()
СТОП([флаг_закрытия])
УСТАНОВИТЬ.ЗНАЧЕНИЕ(ссылка, значения)
УСТАНОВИТЬ.ИМЯ(текст_имени, [значение])


АРГУМЕНТ([строка_имени], [номер_типа_данных], [ссылка])

Defines an argument for a custom function.

строка_имениThe defined name that will be assigned to the argument. If this parameter is omitted then no name will be assigned.
номер_типа_данныхThe acceptable data type(s) for the argument value. It can be any combination of the following (to specify more than one value, add the numbers together):
1Число
2Текст
4Логические
8Ссылка
16Ошибка
64массив
If this parameter is omitted it defaults to 7.
ссылкаThe cell reference where the argument value will be stored. If this parameter is omitted then the argument value will not be stored.


ВОЗВРАТ([значение])

Forces the macro to end, and if it is a custom function then to return the specified value.

значениеFor custom functions, the value to be returned.


ДЛЯ(имя_счетчика, нач_ном, кон_число, [шаг_ном])

Performs a group of instructions a specified number of times. The end of the group is indicated by a СЛЕД function.

имя_счетчикаA defined name that will be used to store the current index.
нач_номThe initial value to be assigned to the counter.
кон_числоThe last value to be assigned to the counter.
шаг_номThe value to be added to the counter each time around the loop. If this parameter is omitted it defaults to 1.


ДЛЯ.ЯЧЕЙКИ(ссылка_на_имя, [ссылка_на_область], [проп_пустые])

Performs a group of instructions for each cell in a specified area. The end of the group is indicated by a СЛЕД function.

ссылка_на_имяA defined name that will be used to store the current reference.
ссылка_на_областьThe range of cells to be processed.
If this parameter is omitted it defaults to the current selection.
проп_пустыеWhether blank cells are to be skipped. The possible values are:
ЛОЖЬAll cells in the area are processed
ИСТИНАOnly the non-blank cells in the area are processed
If this parameter is omitted it defaults to ЛОЖЬ.


ЕСЛИ(логическое_выражение)

Specifies a logical test that conditions the execution of a block of statements.

логическое_выражениеAn expression that results in ИСТИНА or ЛОЖЬ.


ЖДАТЬ([дата_как_число])

Forces the macro to wait until the date/time specified by the serial number.

дата_как_числоThe date/time when the macro is to resume. If this parameter is omitted the macro does not wait.


ИНАЧЕ()

Introduces the block of statements to be processed when the corresponding ЕСЛИ or ИНАЧЕ.ЕСЛИ condition is false.



ИНАЧЕ.ЕСЛИ(логическое_выражение)

Specifies another logical test that conditions a block of statements when the corresponding ЕСЛИ or ELSE.IF condition is false.

логическое_выражениеAn expression that results in ИСТИНА or ЛОЖЬ.


КОН.ЕСЛИ()

Specifies the end of the block of statements conditioned by the corresponding ЕСЛИ or ИНАЧЕ.ЕСЛИ.



НАЧСНОВА([номер_уровня])

Specifies the number of levels that will be skipped when this macro returns.

номер_уровняThe number of levels to skip. If this parameter is omitted then all levels are skipped.


ПЕРЕЙТИ(ссылка)

Forces the macro to continue with the statement at the reference.

ссылкаThe reference of the cell where macro execution is to continue.


ПЕРЕСЧИТЫВАЕМАЯ([флаг])

Specifies whether a user-defined function is to be recalculated each time the worksheet changes.

флагWhether the function is volatile. The possible values are:
ЛОЖЬThe function is not volatile
ИСТИНАThe function is volatile
If this parameter is omitted it defaults to ИСТИНА.


ПОКА(лог_выражение)

Specifies a logical test that conditions the execution of a block of statements multiple times. The statements between the ПОКА and СЛЕД functions will be repeated as long as the logical test returns the value ИСТИНА.

лог_выражениеAn expression that results in ИСТИНА or ЛОЖЬ.


ПРЕКР()

Ends the processing of a ДЛЯ, ДЛЯ.ЯЧЕЙКИ or ПОКА loop. The macro will continue with the statement after the СЛЕД function.



РЕЗУЛЬТ([ном_типа])

Specifies the return type of a user-defined function.

ном_типаThe preferred data type(s) for the return value. It can be any combination of the following (to specify more than one value, add the numbers together):
1Число
2Текст
4Логические
8Ссылка
16Ошибка
64массив
If this parameter is omitted it defaults to 7.


СЛЕД()

Specifies the end of the block of statements contained in a ДЛЯ, ДЛЯ.ЯЧЕЙКИ or ПОКА loop.



СТОП([флаг_закрытия])

Terminates all running macros.

флаг_закрытияWhether, in an Авто_закрыть macro, to prevent the workbook from being closed (not currently implemented).


УСТАНОВИТЬ.ЗНАЧЕНИЕ(ссылка, значения)

Stores the specified values in the specified cells on the macro sheet. Do not use this function to try to update cells on a worksheet.

ссылкаThe cells where the values are to be stored.
значенияThe values to be stored.


УСТАНОВИТЬ.ИМЯ(текст_имени, [значение])

Assigns a defined name to the specified value.

текст_имениThe defined name to use.
значениеThe value to be associated with the name. If this parameter is omitted then the name is deleted.