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

formulas

ResolvedVersion Standard

Simon has attended:
Excel VBA Intro Intermediate course

Formulas

How do I imbed formulas into VBA macro code?

RE: Formulas

Hi Simon

Thankyou for your question

I am assuming that you want to use the functions that come as standard with Excel

These functions are called worksheet functions, and are child objects of the application object. The following code uses the sum function to add up a given range of cells and insert it into cell b31

Range("b31").Value = Application.WorksheetFunction.Sum("B2:B30")


All the standard functions can be accessed in this way

Hope this is useful

Regards

Stephen

Excel tip:

The Easiest and Quickest Way to use Autosum in Excel 2010

Autosum is used frequently in Excel. As with almost every feature of Excel, there are more ways than one to use each feature. Below is the simplest way to use the Autosum feature.

1) Go to the bottom of the column of data.

2) Shortcut click in the column then Ctrl + down arrow

3) Use Alt + = for Autosum and press the enter key to complete.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.