functions

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Functions

Functions

resolvedResolved · 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?

Edited on Mon 18 May 2009, 08:46

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.

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Multiple Lines of Text in a Cell

As an alternative to the Text Wrapping facility, type a word or two, press Alt+Enter to get a new line, type more text, and continue the process for as many lines as you need. Enter as normal when you have finished.

The line break is not affected by changing the column width, as text wrapping. To remove this you must edit the cell and remove the invisible character and replace with a normal space.

View all Excel hints and tips


Server loaded in 0.08 secs.