Returning information Entered in a Worksheet

In some Visual Basic procedures you will undoubtedly need to return the contents of a cell or a range of cells. Although you can use either the Value or Formula property, this time the two Range object properties are not interchangeable.

■ The Value property displays the result of a formula entered in a specified cell. If, for example, cell A1 contains the formula = 4 * 25, then the instruction ?Range("A1").Value will return the value 100.

■ If you want to display the formula instead of its result, you must use the Formula property: ?Range("A1").Formjla. Excel will display the formula = 4 * 25 instead of its result (100).

0 0

Post a comment