Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Functions
Functions
Resolved · Low Priority · Version 2007
Chris has attended:
Excel VBA Intro Intermediate course
Functions
When functions were used to generate the totals, they appeared in the spreadhseet as values. Is it possible to insert them as formulae instead of values, so that they can be edited?
For upcoming training course dates see: Pricing & availability
RE: functions
Hi Chris
Thank you for your question
The easiest way to do this is to use the formulaR1C1 method of the range object. For example
ActiveCell.FormulaR1C1 = "=AVERAGE(RC[-4]:RC[-2])"
Places a function that calculates the average values in the cells 4 to 2 columns to the left of the active cell. I suggest manually entering some formulae into a worksheet while the macro recorder is on, so that you can get a better feel for the syntax
Regards
Stephen
Tue 26 May 2009: Automatically marked as resolved.
|
