ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Dollar signs in VBA (https://www.excelbanter.com/excel-programming/358601-dollar-signs-vba.html)

Kletcho

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?


Martin

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?



Andy Pope

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

Chip Pearson

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" wrote in message
oups.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?




Kletcho

Dollar signs in VBA
 
Thank you.



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com