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?
 

Some videos you may like

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

rjp

Board Regular
Joined
Jan 5, 2006
Messages
148
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"
 

Watch MrExcel Video

Forum statistics

Threads
1,108,788
Messages
5,524,879
Members
409,609
Latest member
Channingz

This Week's Hot Topics

Top