Save file using cell reference

TyeReece

Board Regular
Joined
Aug 3, 2007
Messages
136
I need to be able to automatically save several files after I make changes to a file name that is based on a cell reference, constant text (e.g., "ProgramFile") and date (month/year format). I want to put this on the end of the macro I have that creates the files so I don't have to go thru the process of saving each file maunally. Is there a quick string of code that does this?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Assuming your filenames are in column A, you can use the following code:

Code:
    For i = 1 To Range("A" & Rows.Count).End(xlUp).Row    
    Set NewBook = Workbooks.Add
    With NewBook
        .Title = Range("A" & i).Value
        .SaveAs Filename:= Range("A" & i).Value & ".xls"
    End With
    Next i

This code will create the files with the text inside column A until the first occurrence of a blank column A cell in the same directory.
 
Upvote 0
insert then automatically save...?

Hi guys
I need a Macro that inserts a Value "n" from a list in "sheet2" to a cell in "sheet1" and then saves a filename as this value "n" then proceeds to a next value in the column list and stops as the list ends
thanks in advance..! :biggrin:
 
Upvote 0

Forum statistics

Threads
1,224,550
Messages
6,179,462
Members
452,915
Latest member
hannnahheileen

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