Hello friends:
I have a rather large financial model that calculates commission payout for approximately 30 sales reps. Each rep has his/her own summary worksheet. After all calculations are made I normally save the entire workbook as another file name and remove all formulas completely. I then copy and move each rep summary sheet individually to it's own file and save it (without formulas).
I haven't messed with building a macro for this yet. Any recommendations or things I should keep in mind as I try to do that? Am I going to have to get into the VBA side of it or will I just have to go sheet by sheet and hit an assigned button for the macro to perform the task on said sheet?
Thank you
Last edited by ExcelAteMyHomework; 01-31-2012 at 10:36 AM.
Perhaps something like this?Sub x() Dim ws As Worksheet ThisWorkbook.SaveAs "Whatever.xls" For Each ws In Worksheets ws.UsedRange.Value = ws.UsedRange.Value ws.Copy ActiveWorkbook.Close True, "H:\" & ws.Name & ".xls" Next ws End Sub
So let's assume the active workbook is the file using the macro.
All I want to do is Copy the active worksheet to it's own workbook, remove all formulas, save as worksheet name, move to next worksheet.
What does that code look like?
Thanks!
That's what that code does. What is it not doing that you want it to do?
Maybe I am entering the code incorrectly. I suck at VBA.
Stephen:
I got this working, however I would like to update my save filepath to a specific folder on the specified drive. For example, "H:\Calculations\Commissions\Test". However, when I update my code it actually saves all the files to "H:\Calculations\Commissions" and adds the word "Test" to the beginning of each filename.
Your thoughts?
Nevermind I got this to work.
You asked by PM "is it possible to add on to the code and have a worksheet attach itself to an Outlook email?". Please keep questions on the forum.
I have not done much of this, but you might like to check this site: http://www.rondebruin.nl/tips.htm which has quite a lot on emailing.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks