ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   File Name (https://www.excelbanter.com/excel-programming/324436-file-name.html)

Ronbo

File Name
 
I am trying to copy a workbook in a dir to another dir. The workbook I am
trying to copy is not the Active Workbook. I get this to work with a fixed
name, but I need the name to change each time to the name in Cell (M9) of the
Active Workbook.

Code:
FileCopy ActiveCell, "C:\Path\Dir\"ActiveSheet.Range("M9").Value.xl s""

My problem is adding the cell M9 to the path. What am I doing wrong.

Any help is always apprectiated.

Jim Thomlinson[_3_]

File Name
 
FileCopy ActiveCell, "C:\Path\Dir\" & ActiveSheet.Range("M9").Value & ".xls"

HTH
"Ronbo" wrote:

I am trying to copy a workbook in a dir to another dir. The workbook I am
trying to copy is not the Active Workbook. I get this to work with a fixed
name, but I need the name to change each time to the name in Cell (M9) of the
Active Workbook.

Code:
FileCopy ActiveCell, "C:\Path\Dir\"ActiveSheet.Range("M9").Value.xl s""

My problem is adding the cell M9 to the path. What am I doing wrong.

Any help is always apprectiated.



All times are GMT +1. The time now is 04:13 PM.

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