get path for subfolder

twistsd

New Member
Joined
Sep 8, 2021
Messages
11
Office Version
  1. 365
Platform
  1. Windows
I have an excel file stored on OneDrive in a folder, which has a subfolder called FolderA which has subfolders called site1, site2 etc. I can get the file path for the main file to display in a cell and then concatenate and add the subfolders into another cell. The issue I have is sometimes my pc opens the file and the path is C:\\folder..... and other times its https://onderivefolder, the problem is the "/" & "\" in the concatenate and how to get the correct one depending upon which path type is displayed. Any help on how to best address this would be gratefully appreciated.
Thanks
 
@twistsd
Windows use "\" as the default but "/" works too.
For example in VBA, both works:
VBA Code:
Workbooks.Open "D:\MY DONLOT\561414 - test 1.xlsm"
VBA Code:
Workbooks.Open "D:/MY DONLOT/561414 - test 1.xlsm"

maybe you can manipulate it in your formula.
 
Upvote 0

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,215,064
Messages
6,122,942
Members
449,094
Latest member
teemeren

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