ExcelSetCellAsFormula
Estrutura
ExcelSetCellAsFormula(iRow, iCol, sValue)
Tipo
Procedimento
Descrição
Este procedimento atribui a fórmula à célula indicada na folha atual.
Parâmetros: 3
iRow = A linha da célula. 1 é a linha superior.
iCol = A coluna da célula. 1 corresponde à coluna A
sValue = A fórmula a aplicar à célula.
Exemplo
Experimente
ExcelNewFile(3, "v2003")
ExcelGetSheetByIndex(1)
ShowMessage(ExcelGetCellIsFormula(1,1)) 'Retorna "0"
ExcelSetCellAsFormula(1,1,"=1+2") ' Fórmula =1+2
ShowMessage(ExcelGetCellIsFormula(1,1)) 'Retorna "1"
Exceto
ShowMessage(LastExceptionMessage)
Fim da tentativa