Change workbook name to same as host folder name.

GedSalter

Board Regular
Joined
Apr 24, 2019
Messages
80
Hi all,


Is there a way to automatically change workbook name dependent on which folder its in?

If say the host folder is called "2019" and the workbook is called "test.xlsm". When "test.xlsm" workbook is placed into the "2019" folder the workbook then changes name to 2019.xlsm?

regards

Ged
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Hi,

What is going to happen to the second file stored in the folder ?

Do you plan to have as many folders as individual files ?
 
Upvote 0
there wont be a second file, im hoping. I was hoping the file automatically changes its name so only 1 file is present
 
Upvote 0
If your rule is 1 File = 1 Folder ...

you can Move or Copy your file from Folder1 to Folder2 and then rename it ...
 
Upvote 0
and then to Rename ... simply

Code:
<code>Name OldFileName As NewfileName</code>

Hope this will help
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,207
Members
452,618
Latest member
Tam84

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