You are partially correct. For all String functions (Dir, Mid, Format,
etc.), if you include the $ sign at the end of the function name, that
function will return a value of type String. However, if you don't include
the $ sign, the function will return a Variant with a sub-type of String.
The only time including the $ sign will really matter is if you use the
String function in a very large loop... Variants take up more memory (which
probably won't matter if you are assigning the output to a variable declared
as a String) and are slower to work with, so (in a large loop) the this
slowness will become measurable.
Rick
"stefan onken" <(E-Mail Removed)> wrote in message
news:7cbd5b67-41b7-4ecd-8744-(E-Mail Removed)...
> hi Stefi,
> i used the code from my code collection, where i copied some
> codefragment with Dir$ a while ago.
> so, I`m not sure if this is correct:
> you can write
> Dim strText As String
> also
> Dim strText$
>
> therefore Dir$ forces Dir to return a String, but it does it without
> the $ as well.
> thank you for making me thinking about it (and changing my code
> collection 
>
> stefan
>
> On 30 Mai, 09:56, Stefi <St...@discussions.microsoft.com> wrote:
>> Thanks Stefan, fso.CopyFile is the very method I was looking for, it
>> works!
>> By the way, what does the $ sign means in Dir$ function? XL Help doesn't
>> mention this format.
>
>