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

guido09 1 Posts Sunday February 11, 2018Registration date February 11, 2018 Last seen - Feb 11, 2018 at 10:16 AM - Latest reply: ac3mark 8846 Posts Monday June 3, 2013Registration dateModeratorStatus February 23, 2018 Last seen
- Feb 13, 2018 at 04:59 PM
Hello,

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.
See more 

3 replies

Reply to this topic
ac3mark 8846 Posts Monday June 3, 2013Registration dateModeratorStatus February 23, 2018 Last seen - Feb 12, 2018 at 05:02 PM
0
Helpful
2
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.
ac3mark 8846 Posts Monday June 3, 2013Registration dateModeratorStatus February 23, 2018 Last seen - Feb 13, 2018 at 04:59 PM
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
Respond to ac3mark