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

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
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,214,895
Messages
6,122,128
Members
449,066
Latest member
Andyg666

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