View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Stripping Path from File String

Thanks for the research. I usually use the while loop myself.

I figured there was overhead with evaluate - but didn't think as much as
with fileio - so you at least confirmed that. Still, it appears to be a
dog. That might be insightful for those that choose to use [A1] notation.
I played with that a while back and found it about 14 times slower than
Range("A1") type notation.


--
Regards,
Tom Ogilvy

"Tushar Mehta" wrote in message
news:MPG.1a9bcc83c6c4e5f09896ef@news-server...
Hi Tom,

Nice in its simplicity, is what I meant.

You got me doing some analysis (totally unwarranted given all that I
had to do yesterday <g)

For 27,800+change files,
DIR() took 2.5 seconds
Evaluate() 1.5 seconds
StrReverse(Left(Instr(StrReverse(...)))) 0.2 seconds
a custom function with a while loop to find the last occurence of the
token of interest < 0.1 seconds.

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
You don't think doing a file io to get the filename is a bit slow?

Don't get me wrong, I have used Dir myself when I am lazy, but . . .