Rename excel files in a folder

ikantimahanti

New Member
Joined
May 12, 2011
Messages
15
I started a new job in Cognos reporting. We scheduled to run reports n save(in Excel format) in a particular folder. But the reports are saving with a unique system generated numbers. I need to save the Excel file names with a filename derived from cell A1.

Please help with a solutions, any help would be greatly appreciated.

Thanks,
Isaac
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Maybe like this

Code:
Sub SaveMe()
ActiveWorkbook.SaveAs Filename:=Sheets("Sheet1").Range("A1").Value & ".xls"
End Sub
 
Upvote 0
Open your file then press ALT + F11 to open the Visual Basic Editor, select Module from the Insert menu, copy the code and paste into the white space on the right. Press ALT + Q to close the code window.

Press ALT + F8, click on SaveMe then click the Run button.
 
Upvote 0
Run-time error'1004'

VB projects and XLM sheets cannot be saved in a macro-free workbook. It didnt take me to save as option to save it as macro-free...
 
Upvote 0
Sorry, if you are using Excel 2007 or later

Code:
Sub SaveMe()
ActiveWorkbook.SaveAs Filename:=Sheets("Sheet1").Range("A1").Value & ".xlsm", FileFormat:=xlOpenXMLWorkbookMacroEnabled
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,827
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top