Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I change the name of a folder? 1

Status
Not open for further replies.

advox1

Technical User
Nov 28, 2003
26
0
0
GB
Hi

I need to create and change the name of a folder based on the information contained in a specific cell or cells on a spreadsheet.

I can create the folder, but need some help in re-naming it. Can anyone help me out?

Thanks

Jo
 
surely you just name it when you create it:

mPath = "W:\knowledge\Financial Reports\2003-04\Week " & myVar
MkDir mPath


will create a new folder in
W:\knowledge\Financial Reports\2003-04
called Week 24 (where myVar = 24)

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Thanks Geoff...was being a bit thick there!

Jo
 
Hi

I have come across a bit of a problem as I need to copy a workbook into this folder, but each time I create a new folder it will have a unique name, therefore I thought it would be easier to open the folder with a standard name, copy the workbook into it and then re-name it

mkdir"P:\Spreadsheet\New Folder"
filecopy "P:\Spreadsheet\Time.xls","P:\Project\NewFolder\Time.xls"
Then do the re-naming?

Otherwise How do I direct the copied workbook to the right folder when I have just given it a unique name?

Thanks

Joanne
 
Well, if you are using a variable to create the folder name then you must have that stored somewhere.....right ??

mPath = "P:\Project\Week " & myVar
MkDir mPath
filecopy "P:\Spreadsheet\Time.xls",mPath & "\Time.xls"

should do the trick

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Hi

I tried the above code but came up with a compile error as expected:end of statement. Do you have any suggestions?

Thanks

Jo
 
did you just paste it as is ??
If not, can you please post the code you are using

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Hi,

Thanks for your help but I have solved this now.

Jo
 
Would you mind posting the solution so that others can benefit ?

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Ok,

The solution I uesed was

filecopy "P:\Spreadsheet Project\Time\Trial Sheet.xls", "P:\Spreadsheet Project\Testfolder\04_" & myVar & "\Trial Sheet.xls"

Where myVar was the variable data used to create the unique folder name.

Jo
 
thank you

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top