+ Reply to Thread
Results 1 to 10 of 10

A curious question

  1. #1
    Forum Contributor
    Join Date
    03-03-2005
    Posts
    315

    A curious question

    Can someone explain why EXCEL's built-in functions (like SUM, AVERAGE, IRR, NPV) cannot be replicated in terms of efficiency and speed using VBA? As a related issue, what language does EXCEL's code source use?

    Just curious.

    David.

  2. #2
    Bob Phillips
    Guest

    Re: A curious question

    - because Microsoft know all the ins and outs of Excel and the operating
    system and so can take full advantage
    - because VBA is not compiled
    - because Excel uses compiled C code which is much faster than VB or VBA
    - etc.

    --

    HTH

    RP

    "davidm" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Can someone explain why EXCEL's built-in functions (like SUM, AVERAGE,
    > IRR, NPV) cannot be replicated -in terms of efficiency and speed -using
    > VBA? As a related issue, what language does EXCEL's code source use?
    >
    > Just curious.
    >
    > David.
    >
    >
    > --
    > davidm
    > ------------------------------------------------------------------------
    > davidm's Profile:

    http://www.excelforum.com/member.php...o&userid=20645
    > View this thread: http://www.excelforum.com/showthread...hreadid=501971
    >




  3. #3
    Forum Contributor
    Join Date
    03-03-2005
    Posts
    315
    <<because Excel uses compiled C code which is much faster than VB or VBA>>


    Many thanks Bob. You have confirmed my sneaking suspicion. I will reserve a clarification on Compiled vs Interpreted language for another time.

    David
    Last edited by davidm; 01-17-2006 at 07:25 AM.

  4. #4

    Re: A curious question

    Thanks for yur response. But i wanted to do the filtering operation
    through VBA macro. so that the process can be automated.


  5. #5
    Bob Phillips
    Guest

    Re: A curious question

    You seem to be responding to the wrong thread.

    --

    HTH

    RP

    <[email protected]> wrote in message
    news:[email protected]...
    > Thanks for yur response. But i wanted to do the filtering operation
    > through VBA macro. so that the process can be automated.
    >




  6. #6
    Bob Phillips
    Guest

    Re: A curious question

    Don't forget also that when you use Excel, it is storing and updating
    internal information all the time, so it has a whole bunch of information
    that any user written routijne would probably have to determine. May not be
    a big issue with say a simple SUM, but it could get critical in other areas,
    such as determining the last value in a column.

    There are so many reasons, which is why VBA should always be the last resort
    IMO, never the first.

    --

    HTH

    RP

    "davidm" <[email protected]> wrote in
    message news:[email protected]...
    >
    > because Excel uses compiled C code which is
    > much faster than VB or VBA
    >
    > Many thanks Bob. You have confirmed my sneaking suspicion. I will
    > reserve a clarification on Compiled vs Interpreted language for another
    > time.
    >
    > David
    >
    >
    > --
    > davidm
    > ------------------------------------------------------------------------
    > davidm's Profile:

    http://www.excelforum.com/member.php...o&userid=20645
    > View this thread: http://www.excelforum.com/showthread...hreadid=501971
    >




  7. #7
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187
    VBA the last resort never the first?

    Sounds like a point of view designed to raise the temperature. Or one for the pub!

    Many is the time I have taken a traditional spreadsheet and re-written the calculations into VBA to make the processing quicker and more easily understood.

    Regards,
    Tony

  8. #8
    Norman Jones
    Guest

    Re: A curious question

    Hi Tony,

    > Many is the time I have taken a traditional spreadsheet and re-written
    > the calculations into VBA to make the processing quicker


    I would normally expect Excel formulae or inbuilt functions to be faster
    than a corresponding VBA solution


    ---
    Regards,
    Norman



    "tony h" <[email protected]> wrote in
    message news:[email protected]...
    >
    > VBA the last resort never the first?
    >
    > Sounds like a point of view designed to raise the temperature. Or one
    > for the pub!
    >
    > Many is the time I have taken a traditional spreadsheet and re-written
    > the calculations into VBA to make the processing quicker and more
    > easily understood.
    >
    > Regards,
    > Tony
    >
    >
    > --
    > tony h
    > ------------------------------------------------------------------------
    > tony h's Profile:
    > http://www.excelforum.com/member.php...o&userid=21074
    > View this thread: http://www.excelforum.com/showthread...hreadid=501971
    >




  9. #9
    Bob Phillips
    Guest

    Re: A curious question

    I didn't say never, I said last resort.

    --

    HTH

    RP

    "tony h" <[email protected]> wrote in
    message news:[email protected]...
    >
    > VBA the last resort never the first?
    >
    > Sounds like a point of view designed to raise the temperature. Or one
    > for the pub!
    >
    > Many is the time I have taken a traditional spreadsheet and re-written
    > the calculations into VBA to make the processing quicker and more
    > easily understood.
    >
    > Regards,
    > Tony
    >
    >
    > --
    > tony h
    > ------------------------------------------------------------------------
    > tony h's Profile:

    http://www.excelforum.com/member.php...o&userid=21074
    > View this thread: http://www.excelforum.com/showthread...hreadid=501971
    >




  10. #10
    Tom Ogilvy
    Guest

    Re: A curious question

    Turn on the macro recorder and then set your filter manually.

    Now turn off the macro recorder and look at the recorded code. This will
    show you how to do it with VBA. Debra's site also has VBA examples.

    --
    Regards,
    Tom Ogilvy


    <[email protected]> wrote in message
    news:[email protected]...
    > Thanks for yur response. But i wanted to do the filtering operation
    > through VBA macro. so that the process can be automated.
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1