How to save a copy of an excel sheet using macros? [Closed]

Registration date
Sunday February 11, 2018
Last seen
February 11, 2018
 Blocked Profile -

excel guru's,

I am struggling with a problem which should be easy (i think), but with my lack of knowledge of VBA i am stuck.
I have an excel file where daily data from production batches is filled in. It calculates some waste numbers etc.
I can select different products (though Vlookup's) to change some cells with text and/or values.
What i need is that with a click on a macro, a copy of sheet1 is being saved in a new file (workbook) where the filename is coming from a cell from the original file. After the succesfull save (pop up maybe?) the original file should keep its original name.

1 reply

This is simple,

Go to file, select SAVE as, and go for it!

OR, record a macro of all that you wish for this "EASY BUTTON" to do, and assign a key, and viola!
Thanks for your solution, but i knew this already and this is not what i want. I want it automated by a click on a button. With a recorded macro it isnt possible to save the file with a specific name from a cell.
Blocked Profile
Sure it is. Get the cell value, store it as a variable, and save it.

fName = thisworkbook.worksheets("sheet1").range("A1").value
thisworkbook.worksheets("Sheet1").SaveAs Filename:=fName

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!