PC Review


Reply
Thread Tools Rate Thread

application worksheetfunctions fail

 
 
Sybmathics
Guest
Posts: n/a
 
      23rd Feb 2008
Hi all,


I am wondering why some orksheetfunctions can be addressed and others can't.

If you look in the autolist of application.worksheetfunctions there is
no suggestion for Find.
But, when you address it in a module as
mystring=application.worksheetfunction.find(all the proper arguments) it
will run as expected.
However, with the worksheetfunctions like value or date, when run in a
udf you will always end up with #value!.

What's the logic?


Any help is greatly appreciated.

Greets


Sybolt
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      23rd Feb 2008
Look in the VBA help index for FIND or record a macro while doing your find
to see how.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Sybmathics" <(E-Mail Removed)> wrote in message
news:47c02a32$0$14359$(E-Mail Removed)...
> Hi all,
>
>
> I am wondering why some orksheetfunctions can be addressed and others
> can't.
>
> If you look in the autolist of application.worksheetfunctions there is no
> suggestion for Find.
> But, when you address it in a module as
> mystring=application.worksheetfunction.find(all the proper arguments) it
> will run as expected.
> However, with the worksheetfunctions like value or date, when run in a udf
> you will always end up with #value!.
>
> What's the logic?
>
>
> Any help is greatly appreciated.
>
> Greets
>
>
> Sybolt


 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      23rd Feb 2008
VBA has its own version. Look at InStr in VBA's help.



Sybmathics wrote:
>
> Hi all,
>
> I am wondering why some orksheetfunctions can be addressed and others can't.
>
> If you look in the autolist of application.worksheetfunctions there is
> no suggestion for Find.
> But, when you address it in a module as
> mystring=application.worksheetfunction.find(all the proper arguments) it
> will run as expected.
> However, with the worksheetfunctions like value or date, when run in a
> udf you will always end up with #value!.
>
> What's the logic?
>
> Any help is greatly appreciated.
>
> Greets
>
> Sybolt


--

Dave Peterson
 
Reply With Quote
 
Sybmathics
Guest
Posts: n/a
 
      23rd Feb 2008
Don Guillett schreef:
> Look in the VBA help index for FIND or record a macro while doing your
> find to see how.
>

Don, thanks for the quick reply.

I had no trouble with the find function, though.
It works as expected.

I want to know why some worksheetfunctions can be addressed in VBA and
others can't.

The find function can be addressed even though it's not in the autolist.
Excel functions like date or value can not be addressed.

I don't see why.
 
Reply With Quote
 
Sybmathics
Guest
Posts: n/a
 
      23rd Feb 2008
Dave Peterson schreef:
> VBA has its own version. Look at InStr in VBA's help.
>
>


I have no problem with Find.

I have a problem with date or value.

Are there vba alternatives for the excel worksheetfunctions like date or
value


TIA

Sybolt
 
Reply With Quote
 
Gary''s Student
Guest
Posts: n/a
 
      23rd Feb 2008
All can be used, not all directly. For some you need to use =EVALUATE()


--
Gary''s Student - gsnu200770


"Sybmathics" wrote:

> Don Guillett schreef:
> > Look in the VBA help index for FIND or record a macro while doing your
> > find to see how.
> >

> Don, thanks for the quick reply.
>
> I had no trouble with the find function, though.
> It works as expected.
>
> I want to know why some worksheetfunctions can be addressed in VBA and
> others can't.
>
> The find function can be addressed even though it's not in the autolist.
> Excel functions like date or value can not be addressed.
>
> I don't see why.
>

 
Reply With Quote
 
Bernard Liengme
Guest
Posts: n/a
 
      23rd Feb 2008
QUOTE: I want to know why some worksheetfunctions can be addressed in VBA
and others can't

In general, you cannot use an Excel function when VBA has an equivalent one.
For example SQRT|Sqr; MOD|Mod (although the results do not agree with
negative values); SIN|Sin, and many more pairs - only the VBA function can
be used in a module

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Sybmathics" <(E-Mail Removed)> wrote in message
news:47c03386$0$14354$(E-Mail Removed)...
> Don Guillett schreef:
>> Look in the VBA help index for FIND or record a macro while doing your
>> find to see how.
>>

> Don, thanks for the quick reply.
>
> I had no trouble with the find function, though.
> It works as expected.
>
> I want to know why some worksheetfunctions can be addressed in VBA and
> others can't.
>
> The find function can be addressed even though it's not in the autolist.
> Excel functions like date or value can not be addressed.
>
> I don't see why.



 
Reply With Quote
 
Sybmathics
Guest
Posts: n/a
 
      23rd Feb 2008
Gary''s Student schreef:
> All can be used, not all directly. For some you need to use =EVALUATE()
>
>


Okay.

Seems promising.
Let me try this one.

Thanks

Sybolt
 
Reply With Quote
 
Sybmathics
Guest
Posts: n/a
 
      23rd Feb 2008
Gary''s Student schreef:
> All can be used, not all directly. For some you need to use =EVALUATE()
>
>


I tried it in several ways.
But, nope.
I keep ending up with #value!

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      23rd Feb 2008
If a vba solution is available do NOT use a worksheet function.

date use dateserial
value use Val("1000") * 3

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Sybmathics" <(E-Mail Removed)> wrote in message
news:47c03507$0$14359$(E-Mail Removed)...
> Dave Peterson schreef:
>> VBA has its own version. Look at InStr in VBA's help.
>>
>>

>
> I have no problem with Find.
>
> I have a problem with date or value.
>
> Are there vba alternatives for the excel worksheetfunctions like date or
> value
>
>
> TIA
>
> Sybolt


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application.WorksheetFunctions AMDRIT Microsoft Excel Programming 4 8th Mar 2006 07:13 PM
excel.worksheetfunctions Max Microsoft Excel Worksheet Functions 13 26th Nov 2005 02:25 AM
WorksheetFunctions PGalla06 Microsoft Excel Programming 1 29th Sep 2005 11:29 PM
Fail in operating my hardware in web application , makes other windows application startup failure. Ryan.ZhYin Microsoft C# .NET 0 25th Jan 2005 08:34 AM
No VBA help for Worksheetfunctions available =?Utf-8?B?VG9wcGVycw==?= Microsoft Excel Worksheet Functions 4 23rd Jan 2005 04:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:15 PM.