Stripping the folder section from CurDir

P

Peter Rooney

OK, so I'm REALLY out of practice..!

If CurDir returns "D:\Data\Project", can anyone remind me of the syntax to
strip out everything other than the D: - I remember that it's some
combination of RIGHT and INSTR - I just can't remember how it goes.

Sorry to be lazy - my brain got stuck in Excel VBA and I can't get it out! :)

Once again, thanks in advance

Pete
 
P

Peter Rooney

OK, so I WAS being lazy - I used:
CurFolder = Right(CurDir, Len(CurDir) - 2)
to strip out the "D:", but I WOULD appreciate some help with the INSTR syntax.

Thanks, in a slightly sheepish way.

Pete
 
J

Jan De Messemaeker

Hi Peter,

I am very surprised that curdie returns the D:\ address and not the \\
address - FillName returns the \\ address for instance.

As for Instr, an example:

Pos=instr("d:\any\file.mpp","\")
then pos=3

HTH
 
P

Peter Rooney

Jan,

The Instr example is just what I needed! :)
As for the D:\ business, I just pasted the wrong code into my example.
Sorry for any confusion caused.
Thanks
Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top