ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   COPY EXCEL FILE (https://www.excelbanter.com/excel-programming/310764-copy-excel-file.html)

Myrna Rodriguez

COPY EXCEL FILE
 

How can I copy an excel file a folder??
The folder is named accordingly to an excel cell.value.
This folder is created using a macro.

I tried this code:
FileCopy "S:\Order Folders\QA.xls", "S:\Order Folders\2004 Open
Orders\04_ & cell.Value\QA.xls"

The problem I am debugging is designating the path
04_ & cell.Value. Cell.Value will always be different depending what the
user types in the excel cell.

This is my file folder sequence in the S: drive
Order Folders
2004 Open Orders
04_XXX (I will the have the file QA.xls in this folder)

Thanks much for your help & continue to enjoy life!!
Myrna



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Tom Ogilvy

COPY EXCEL FILE
 
FileCopy "S:\Order Folders\QA.xls", _
"S:\Order Folders\2004 Open Orders\04_" & _
format(cell.Value,"000") _
& "\QA.xls"

or just cell.value. Depends on what the format of the file name is.

FileCopy "S:\Order Folders\QA.xls", _
"S:\Order Folders\2004 Open Orders\04_" & _
cell.Value _
& "\QA.xls"


--
Regards,
Tom Ogilvy

"Myrna Rodriguez" wrote in message
...

How can I copy an excel file a folder??
The folder is named accordingly to an excel cell.value.
This folder is created using a macro.

I tried this code:
FileCopy "S:\Order Folders\QA.xls", "S:\Order Folders\2004 Open
Orders\04_ & cell.Value\QA.xls"

The problem I am debugging is designating the path
04_ & cell.Value. Cell.Value will always be different depending what the
user types in the excel cell.

This is my file folder sequence in the S: drive
Order Folders
2004 Open Orders
04_XXX (I will the have the file QA.xls in this folder)

Thanks much for your help & continue to enjoy life!!
Myrna



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!




Myrna Rodriguez

COPY EXCEL FILE
 

Thanks much Mr.Ogilvy for showing me magic!
keep enjoying life! myrna


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 11:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com