Macro to save worksheet as separate file?

aythieriot

New Member
Joined
Apr 19, 2011
Messages
7
Hey all,

What I'm hoping to create is an easier way of our wine bar to check its current inventory against what they should have and ultimately provide a very basic printout which can be e-mailed to our central office and then be printed off over here.

The file, due to several macros already existing (i.e. add new product, update product list, update order to order history) the file is rather large and sending the whole macro enabled file twice weekly is unnecessary. Also, I would like the file sent to the main office to be saved under the name "OrderDATE", where date would be a stamp from the day of the order. As you may also know, changing the name of an Excel file with Macros can become a headache.

Therefore, I really just need a macro to copy the order to a new blank worksheet, filter out all products for which they ordering 0, and preferably save just the new worksheet as its own basic, smaller Excel file.

Thoughts?

Thanks, and by the way I'm using exclusively "Record Macro," not VBA savvy yet...
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Workbooks.Add

Workbooks("Book1.xls").SaveAs("filename.xls")

ThisWorkbook.Worksheets("Sheet1").Copy After:=Worksheets("Sheet3")
 
Upvote 0
Thanks, Glory, I'll give it a shot but going to need a run through VBA before using too well I would imagine. Any way to get the new file name from the sheet I just made? I.e. because the page is titled Order:(one cell) + PasteValue of the date. Is it possible to, instead of typing the file´s name, reference the cell within the sheet with the date to use that for said filename?

Thanks again
 
Upvote 0
MrVar = ThisWorkbook.Range("cell containing the name of the file")

Workbooks("Book1.xls").SaveAs(MyVar & ".xls")
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,285
Members
452,902
Latest member
Knuddeluff

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