Saltar para o conteúdo principal
Versão: 20 R8

VP SET VALUE

VP SET VALUE ( rangeObj : Object ; valueObj : Object )

ParâmetroTipoDescrição
rangeObjObject->Objeto intervalo
valueObjObject->Valores de células e opções de formato

Descrição

O comando VP SET VALUE atribui um valor especificado a um intervalo de células designado.

The command allows you to use a generic code to set and format the types of values in rangeObj, whereas other commands, such as VP SET TEXT VALUE and VP SET NUM VALUE, reduce the values to specific types.

Em rangeObj, passe um intervalo de células (criado, por exemplo, com VP Cell ou VP Column) cujo valor você deseja especificar. Se rangeObj incluir várias células, o valor especificado será repetido em cada célula.

O parâmetro valueObj é um objeto que inclui propriedades para o valor e o format para atribuir ao rangeObj. Pode incluir as seguintes propriedades:

PropriedadeTipoDescrição
valueInteger, Real, Boolean, Text, Date, NullValor a atribuir a rangeObj (exceto - hora). Passar null para apagar o conteúdo da célula.
timeRealValor hora (em segundos) a atribuir a rangeObj
formatTextPadrão para propriedade valor/tempo. Para informações sobre padrões e caracteres de formatação, consulte o parágrafo formato de célula.

Exemplo

//Set the cell value as False
VP SET VALUE(VP Cell("ViewProArea";3;2);New object("value";False))

//Set the cell value as 2
VP SET VALUE(VP Cell("ViewProArea";3;2);New object("value";2))

//Set the cell value as $125,571.35
VP SET VALUE(VP Cell("ViewProArea";3;2);New object("value";125571.35;"format";"_($* #,##0.00_)"))

//Set the cell value as Hello World!
VP SET VALUE(VP Cell("ViewProArea";3;2);New object("value";"Hello World!"))

//Set the cell value as current date
VP SET VALUE(VP Cell("ViewProArea";4;2);New object("value";Current date))

//Set the cell value as current hour
VP SET VALUE(VP Cell("ViewProArea";5;2);New object("time";Current hour))

//Set the cell value as specific date and time
VP SET VALUE(VP Cell("ViewProArea";3;9);New object("value";!2024-12-18!);"time";?14:30:10?;"format";vk pattern full date time))

//Erase cell content
VP SET VALUE(VP Cell("ViewProArea";3;9);New object("value";Null))

Veja também

Cell Format
VP Get values
VP SET VALUE
VP SET BOOLEAN VALUE
VP SET DATE TIME VALUE
VP SET FIELD
VP SET FORMULA
VP SET NUM VALUE
VP SET TEXT VALUE
VP SET TIME VALUE