View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Stefi Stefi is offline
external usenet poster
 
Posts: 2,646
Default copy files by name patterns with wildcard

Thanks Rick for the explanation!
Stefi


€˛Rick Rothstein (MVP - VB)€¯ ezt Ć*rta:

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