98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Functions
Functions
Resolved · Low Priority · Version 2003
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?
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
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
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Validating text entries1. Select the range of cells.
where A1 is the first cell in the range. 6. Click OK. |