InStrRev

mAP3d

New Member
Joined
Sep 30, 2015
Messages
12
Hi guys,

I am working on excel 2010 and have a file path from which I need to separate the file name. Since the files could always be in different places, I wanted to search for the last "\" with InStrRev. Then I wanted to subtract this value from the length (Len) of the string and use this value with "Right()" to cut of only the file name. My problem is, that InStrRev just doesn't show a value.

Right(strListe, Len(strListe) - InStrRev(strListe, "\"))

The file path is stored in "strListe", its only InStrRev which doesn't do his job.

Someone got an idea?

btw it worked with InStr but I can not use this value.
 
Don't know if this is worth knowing but if you use Dir with the full path and filename it only returns the filename, so kind of no need to use InstrRev or any other text parsing.
 
Upvote 0

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