Can vba variable names end with a $ or &? And if they can, is there
something special about them?
I see rules that state: "The name can't contain a space or any of the
following characters: . ! # $ % & @"
But - here I am looking at at a program that has them...
Thank you.
Those are 'Type' symbols used as shortcuts for typing 'As <datatype>'.
They can be used to Dim/declare a variable but won't be needed when
using the variable in code...
Dim sData$ '//string
Dim lLastRow& '//long
Dim n% '//integer
..and so on...
sData = "MyName": lLastRow = 500: n = 0
...uses the variables without the 'Type' symbols. Note that there are
some structs that do not permit using 'Type' symbols, and VB will let
you know when you try using them inappropriately.
Note that some functions also implement the symbols. Some that come to
mind for string functions are...
Mid$()
Left$()
Right$()
--
Garry
Free usenet access at
http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion