File Management

JamieDuncan

Board Regular
Joined
Aug 23, 2006
Messages
132
I have a workbook that upon opening asks for a reference number, eg.123

When the reference number has been given, the workbook puts that ref no in cell J10 of the sheet 'Data Input'; then it creates a folder named 123 next to the original file and saves itself under the new name of 123MASTER inside this new folder.

What I am trying to do if it is possible is have a command button that would bring up an input box asking for a new reference number (in the 123MASTER file) which would then change the name of the folder 123 into the new ref number eg. 456 add an x to it so it would become 456x (clear that it has been changed) then change the name of 123MASTER to 456xMASTER.

Is this possible?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
You can use the Name function:

Code:
Name OldName As Newname

So assuming the new name is in a variable called 'refNum' you'd have something like:

Code:
Name ThisWorkbook.Path & "\" & Cells(10, "J").Value & "MASTER" As ThisWorkbook.Path & "\" & refNum & "XMASTER"
Cells(10, "J").Value = refNum & "X"
 
Upvote 0

Forum statistics

Threads
1,214,874
Messages
6,122,036
Members
449,062
Latest member
mike575

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