ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Rename File from list (https://www.excelbanter.com/excel-programming/295090-rename-file-list.html)

Cesar Zapata[_2_]

Rename File from list
 
Hello,

I'm trying to make a kind like batch renamer in excel any ideas will be
appreaciated.

What i'm trying to do is to rename the "Active Workbook" with the
current name + value of a cell from a list.

for example lets say in cell A1 to a5 I have

NY
CT
MI
NV
TX

so I need to create 5 workbooks ... like

Sales NY.xls
Sales CT.xls
Sales MI.xls
Sales NV.xls
Sales TX.xls

the macro will be part of an addin. Thanks


TIA

CZ

Nigel[_8_]

Rename File from list
 
Try something like the following....

' somewhere to build the file name string
Dim MyFileName As String
MyFileName = "C:\" & Trim(Range("A1").Value) & ".xls"


ActiveWorkbook.SaveAs Filename:=MyFileName, FileFormat:=xlNormal

Cheers
Nigel

"Cesar Zapata" wrote in message
...
Hello,

I'm trying to make a kind like batch renamer in excel any ideas will be
appreaciated.

What i'm trying to do is to rename the "Active Workbook" with the
current name + value of a cell from a list.

for example lets say in cell A1 to a5 I have

NY
CT
MI
NV
TX

so I need to create 5 workbooks ... like

Sales NY.xls
Sales CT.xls
Sales MI.xls
Sales NV.xls
Sales TX.xls

the macro will be part of an addin. Thanks


TIA

CZ





All times are GMT +1. The time now is 04:49 AM.

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