Formula to open current folder one level up

ttratl

Board Regular
Joined
Dec 21, 2004
Messages
168
Hi Everyone,

I have this formula that opens the current folder where my file is stored:

=HYPERLINK(MID(CELL("filename"),1,FIND("[",CELL("filename"))-1),"Open Current Folder")

This works fine. I'd like it to open the folder one level up from the current folder, but I really don't understand formulas well enough to know if this is even possible.

Any ideas?

Thanks
 
Actually I haven't tested this fully, but it may work:

=MID(CELL("filename"),1,FIND("[",CELL("filename"))-1)&".."

If you use that I believe it shows up as the incorrect path visually, but I believe it will point to one level up.
 
Upvote 0

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
After testing it I couldn't get it to work exactly, so I am back to square one, without being able to use it in a formula.
 
Upvote 0
Me too, I got it to work in VBA, say if that formula is in A1, this will open a file 1 folder up..

Workbooks.Open Range("A1").Value & "\test.xls"

That works...
 
Upvote 0
You can use the .. in the Workbooks.Open:
Code:
workbooks.Open "..\Book1.xls"
opens Book1 from the parent directory of the current directory.
 
Upvote 0
I knew that, I was just doing that to verify the formula pointed to the correct folder even though it displays the wrong one...
 
Upvote 0
Hey that's useful! Thanks, Jonmo! (y)

Always glad to know I found something cool...:cool:
But give credit where it's due, I only found that as a follow up on Rorya's first post..
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,895
Members
449,097
Latest member
dbomb1414

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