Add File Name to a Cell without Extension?

slam

Well-known Member
Joined
Sep 16, 2002
Messages
913
Office Version
  1. 365
  2. 2019
Hi all,

I've seen a few ways to do this, but they don't account for file extensions being different lengths - typically 3 (.xls) or 4 (.xlms)

Is there anyway this can be done? My file names will never have a period in them if that helps.

Thanks
 
Thanks very much, I'll give this a go!

It didn't work at first, but that's because someone (in their infinite wisdom) decided to include a "." in the user names, which then formed part of the full file address. I solved it by adding in the section of code you use for the start of the MID so that it finds the first "." after the beginning of the file name.

Thanks again for your help!
 
Upvote 0

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Forum statistics

Threads
1,222,103
Messages
6,163,948
Members
451,867
Latest member
csktwyr

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