functions
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

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

Functions

resolvedResolved · Low Priority · Version 2003

replyReply Thu 30 Oct 2008, 16:02Delegate Nikolas said...

Nikolas has attended:
Excel VBA Intro Intermediate course

Functions

why when i type Worksheetfunction.(any excell function) then it throws an error.
Instead when i use application.(any excel function) then it works. whats the reason that i have to use application and not worksheetfunction?

For upcoming training course dates see: Pricing & availability

replyReply Thu 27 Nov 2008, 12:13Trainer Stephen said...

RE: functions

Hi Nikolas

Thank you for your question

worksheet functions form a collection whose parent is the application object.

Thus the correct form is (for example)

application.worksheetfunction.sum(Range("A1:A15"))

Not all worksheet functions can be accessed in this way. If a required worksheet function is not available then this is often because that function is a VB function and can be accessed by simply typing the function name eg

datediff("yyyy",date1,date2)

Hope this helps

Regards

Stephen

 

Please browse our web site to find out more about
excel-training-course and other Microsoft training courses.

Excel tip:

Display pictures on Chart Data Point

Replacing a single chart data point bar with a picture.
Step 1: Left click on a bar. Then, wait, and do a second single click on the bar. This will select just one data point.

Step 2: Right click on the bar and select Format Data Point.

Step 3: On the fill effects tab, choose a picture. Browse for a picture for that bar. Indicate if you want it to be stretched or stacked. Repeat for each bar.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard