Can this be done?

Steve_B

Board Regular
Joined
Feb 9, 2004
Messages
86
Hi All

I have a string of text in cell A1 similar to this : C:\start\123\solidworks.slddwg (This can vary in length and contents)

In Cell B2 I have a formulae to manipulate the string to get: C:\start\123
I need to get solidworks.slddwg into Cell C2

Any ideas

Steve
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Aladin

This is the full string length. But as I said this can vary!

R:\123\Mach 1\TMFH1\TMH1-04 Tube Fill\TMFH1-04-03 Capper Station\TMFH1-04-03-00 B Capper Assembly.SLDASM
 
Upvote 0
In B2 I Need to see

R:\123\Mach 1\TMFH1\TMH1-04 Tube Fill\TMFH1-04-03 Capper Station
and in C2 I need to see

TMFH1-04-03-00 B Capper Assembly.SLDASM
 
Upvote 0
Steve_B said:
In B2 I Need to see

R:\123\Mach 1\TMFH1\TMH1-04 Tube Fill\TMFH1-04-03 Capper Station
and in C2 I need to see

TMFH1-04-03-00 B Capper Assembly.SLDASM

I didn't try to figure out why the formula for B2 fails for this "path"...

Here a new set:

B2: (modified)

=LEFT(SUBSTITUTE(A1,C2,""),LEN(A1)-LEN(C2)-1)

C2: (same)

=MID(A1,SEARCH(CHAR(127),SUBSTITUTE(A1,CHAR(92),CHAR(127),LEN(A1)-LEN(SUBSTITUTE(A1,CHAR(92),""))))+1,LEN(A1))
 
Upvote 0
Aladin

Sorry for the hassle but I am getting

R:\123\Mach 1\TMFH1\TMH1-04 Tube Fill\TMFH1-04-03 Capper Station\TMFH1-04-03-00 B Capper Assembly.SLDAS

as the return from B2
 
Upvote 0
Thank All it has now been resoved with all your help :pray:

This was the final version

B2:=LEFT(A1,SEARCH(CHAR(127),SUBSTITUTE(A1,"\",CHAR(127),LEN(A1)-LEN(SUBSTITUTE(A1,"\",""))))-1)

C2:=MID(A1,SEARCH(CHAR(127),SUBSTITUTE(A1,CHAR(92),CHAR(127),LEN(A1)-LEN(SUBSTITUTE(A1,CHAR(92),""))))+1,LEN(A1))
 
Upvote 0
Steve_B said:
Thank All it has now been resoved with all your help :pray:

This was the final version

B2:=LEFT(A1,SEARCH(CHAR(127),SUBSTITUTE(A1,"\",CHAR(127),LEN(A1)-LEN(SUBSTITUTE(A1,"\",""))))-1)

C2:=MID(A1,SEARCH(CHAR(127),SUBSTITUTE(A1,CHAR(92),CHAR(127),LEN(A1)-LEN(SUBSTITUTE(A1,CHAR(92),""))))+1,LEN(A1))

Steve,

Replace the one in C2 by the shorter:

=RIGHT(A1,LEN(A1)-FIND(CHAR(127),SUBSTITUTE(A1,CHAR(92),CHAR(127),LEN(A1)-LEN(SUBSTITUTE(A1,CHAR(92),"")))))
 
Upvote 0

Forum statistics

Threads
1,214,413
Messages
6,119,374
Members
448,888
Latest member
Arle8907

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top