Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default referencing worksheet functions

Application.<function_name
Application.WorksheetFunction.<function_name

I've seen both syntax's offered.
Why choose one over the other?

--
David
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default referencing worksheet functions

David,

Actually, you can use Application, Worksheetfunction, or
Application.WorksheetFunction.

If you use Application, you don't get intellisense, with WorksheetFunction
you do.

However, I think you will find problems with some fiunctions in
WorksheetFunction. Not sure all of which, but be aware when you use it, and
then just use Application if this occurs.

Bottom line, code with WorksheetFunction, and test and run with Application
maybe?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"David Turner" wrote in message
...
Application.<function_name
Application.WorksheetFunction.<function_name

I've seen both syntax's offered.
Why choose one over the other?

--
David



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default referencing worksheet functions

David,

The primary difference is how errors are handled. For example,
the Match function causes and error if the lookup value is not
found. If you use the syntax:

Dim Result As Variant
Result = Application.Match(123,Range("A1:A10"),0)

and 123 is not found, Result will contain an error value that you
can test with the IsError function. No special error handling
with On Error is required.

If you use the syntax,

Dim Result As Variant
Result =
Application.WorksheetFunction.Match(123,Range("A1: A10"),0)

and 123 is not found, you'll get a run time error that has to be
handled with an On Error handler.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"David Turner" wrote in message
...
Application.<function_name
Application.WorksheetFunction.<function_name

I've seen both syntax's offered.
Why choose one over the other?

--
David



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default referencing worksheet functions

Thanks to both of you.

--
David
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Functions referencing a different workbook Haydie-lady[_2_] Excel Worksheet Functions 1 April 7th 09 05:14 PM
Need Help with Referencing Functions Libbia Excel Discussion (Misc queries) 1 May 14th 06 02:09 PM
If/cross referencing functions Darren_Preston Excel Worksheet Functions 1 February 23rd 06 07:14 PM
Referencing Cells Using If Functions [email protected] Excel Worksheet Functions 1 August 30th 05 06:54 PM
referencing cols in functions - NPV DesM Excel Worksheet Functions 3 June 9th 05 09:36 AM


All times are GMT +1. The time now is 02:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"