Extracting a strinf drom a string

P

Peter Rooney

OK, I'm stumped.

I have a series of entries in the form

Artist - Title.DOC
I can write a formula easily enough to seperate out the artist part
=LEFT(C10,FIND("-",C10)-2)

But I can't for the life of me work out how to extract the title minus the
..DOC extension.
Can anyone help, please?

Thanks in advance

Pete
 
P

Peter Rooney

Strewth, not only have I become unable to spell properly, but I'm posting on
the wrong board too!
Apologies!

Pete
 
J

John

Peter Rooney said:
OK, I'm stumped.

I have a series of entries in the form

Artist - Title.DOC
I can write a formula easily enough to seperate out the artist part
=LEFT(C10,FIND("-",C10)-2)

But I can't for the life of me work out how to extract the title minus the
.DOC extension.
Can anyone help, please?

Thanks in advance

Pete

Pete,
I'm going to make a big assumption here. Since you posted to a MS
Project newsgroup (although your formula looks more like something one
might see in Excel), I'm going to give you a VBA approach.

Mid(x, InStr(1, x, "-") + 2, InStr(1, x, ".") - InStr(1, x, "-") - 2)
Where "x" is the "artist - title.doc" string

John
Project MVP
 
P

Peter Rooney

John, Thanks very much for getting back, especially when I realised that I'd
inadvertantly posted onto the wrong board.
This VBA solution could be equally useful to me in another application, so
I'll take a look and see if i can make it work.
Thanks very much! :eek:)

Pete
 
J

John

Peter Rooney said:
John, Thanks very much for getting back, especially when I realised that I'd
inadvertantly posted onto the wrong board.
This VBA solution could be equally useful to me in another application, so
I'll take a look and see if i can make it work.
Thanks very much! :eek:)

Pete

Pete,
Yeah I know, the guys in the other newsgroup didn't respond so you
thought you'd try and sneak one in on us. Well you caught me at a good
moment.

You're welcome and thanks for the feedback.
JOhn
 

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