![]() |
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? |
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? |
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 |
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? |
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