Joe gave you a great answer to a question you did not ask. Joe's answer
dealt with variable names and data type suffix characters, however you asked
about chr$ which is not a variable. Chr is a built-in
VB String function and
most (but not all) String function have two forms... one that returns String
value directly (those have the $ sign suffix attached to them) and another
which returns a Variant value having a sub-type of String. In theory, using
the String value version (with the $ sign) is slightly faster than using the
Variant value version. The time difference is pretty much not noticeable
unless you have a huge loop performing extensive String manipulations
(making use of those functions) during each loop, and even then the time
differences should be somewhat smallish.
--
Rick (MVP - Excel)
"kylefoley2000" wrote in message
...
great answer, thank you for your dedication and support
"Joe User" wrote:
"kylefoley2000" wrote:
what does chr$ mean in this code
It's superfluous.
Putting "$" after a variable name ensures that it is treated as String
variable, even if it is not declared as such (and it is not declared as
something else, and it Option Explicit is not declared).
But putting "$" after a function name has not functional value since
functions, especially intrinsic VBA functions, are typed explicitly.
However, some people might argue that putting "$" after any name is
self-documenting. That is, it makes it clearer to the reader what the
code
is doing.
There are many other date-type suffixes. "%" for Integer; "#" for
Double;
and "@" for Currency, to name a view. These numeric suffixes are
especially
useful following constants.
----- original message -----
"kylefoley2000" wrote:
what does chr$ mean in this code
Sub rick()
Dim strabc(1 To 26) As String
Dim i As Integer
Dim strprompt As String
For i = 1 To 26
strabc(i) = Chr$(i + 64)
Next i
strprompt = "hey:" & vbCrLf
For i = 1 To 26
strprompt = strprompt & strabc(i)
Next i
MsgBox strprompt
End Sub