+ Reply to Thread
Results 1 to 5 of 5

Dollar signs in VBA

Hybrid View

  1. #1
    Kletcho
    Guest

    Dollar signs in VBA

    What is the significance of some of the VBA functions having a
    counterpart with a $. For example there is the Mid function and also
    the Mid$ function. What is the difference?


  2. #2
    Martin
    Guest

    RE: Dollar signs in VBA

    As far as I know, it's just for backwards compatibility. Old versions of VBA
    (such as Excel Basic and Word Basic) put a dollar at the end of every
    string/text function. You don't have to bother putting it in now and many of
    the functions have been improved to allow their use on more than just strings.

    "Kletcho" wrote:

    > What is the significance of some of the VBA functions having a
    > counterpart with a $. For example there is the Mid function and also
    > the Mid$ function. What is the difference?
    >
    >


  3. #3
    Andy Pope
    Guest

    Re: Dollar signs in VBA

    Here an interesting discussion on it.
    http://www.dailydoseofexcel.com/arch...on-efficiency/

    Cheers
    Andy

    Martin wrote:
    > As far as I know, it's just for backwards compatibility. Old versions of VBA
    > (such as Excel Basic and Word Basic) put a dollar at the end of every
    > string/text function. You don't have to bother putting it in now and many of
    > the functions have been improved to allow their use on more than just strings.
    >
    > "Kletcho" wrote:
    >
    >
    >>What is the significance of some of the VBA functions having a
    >>counterpart with a $. For example there is the Mid function and also
    >>the Mid$ function. What is the difference?
    >>
    >>


    --

    Andy Pope, Microsoft MVP - Excel
    http://www.andypope.info

  4. #4
    Chip Pearson
    Guest

    Re: Dollar signs in VBA

    Without the $ character, the function returns a Variant
    containing a String. The $ character forces the function to
    return a String type variable. Functions are more efficient with
    the $.


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


    "Kletcho" <kletcho@gmail.com> wrote in message
    news:1144769678.777227.139110@u72g2000cwu.googlegroups.com...
    > What is the significance of some of the VBA functions having a
    > counterpart with a $. For example there is the Mid function
    > and also
    > the Mid$ function. What is the difference?
    >




  5. #5
    Kletcho
    Guest

    Re: Dollar signs in VBA

    Thank you.


+ 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