Save Monthly Data To New Workbook Named As Month

  • I have a spreadsheet that has 3 columns, date, id and amount for the whole year.
    what I need to do is have a macro on another sheet or workbook that has an entry for month. when i enter the month, i need to get all the data for that particular month and then save it with the month name. i am not very sure how i can do this. pivot table does not work as i need to save a file each month. thanks in advance for your help.

  • Re: Macro To Save New File By Month Name


    thanks. i want the macro to save at the end of each month, a new file with the data for that month. for example, in cell a1 i put the month, say Jan. then all the data is filled in and then with a save button, save a new file with month plus file name. thanks

  • Re: Macro To Save New File By Month Name


    You can assign thsi macro to a button, you need to change the destination path of the saved workbook, the macro will prompt you for a month enter one press ok and a new workbook will be saved to your designated path with a sheet for that month named as the original workbook plus the month!


    Dont forget to change

    Quote

    "C:\Documents and Settings\USER\My Documents\

    for your actual path that you want to save it to!

  • Re: Macro To Save New File By Month Name


    thanks for your help. this is great, however i don't want an InputBox to enter month. it should copy the month from cell a1. and file named each month as fileName_Month.xls
    thanks so much.

  • Re: Macro To Save New File By Month Name


    Quote

    pivot table does not work as i need to save a file each month. thanks in advance for your help.

    PivotTable would be my preference with the date field grouped by Month.


    You show only the Month wanted, Save As and convert to PivotTable to static values via Paste Special - Values and then Move the sheet to a new Workbook.


    OR


    Use Drill Down and the wanted Month


    OR


    Use Show Pages...

  • Re: Save Monthly Data To New Workbook Named As Month


    thanks but not sure what drill down or use show pages is.
    and pivot will not work for me as entries are made several times during the day by many users. i know how i can get the data but was not sure how i could get a macro to save a file named to whatever is in cell a1.


    thanks again for all the help.

  • Re: Save Monthly Data To New Workbook Named As Month


    Just change IB for

    Code
    Range("A1").Value

    , Kiz just a word....Dave is right, excel's built in functions are far more efficient and useable, to change destination or what it copies and how in code takes a more time and knowledge, than letting excel do the work for you, take a few minutes to follow daves suggestions to find out how powerful pivot tables are!

  • Re: Save Monthly Data To New Workbook Named As Month


    Thanks, i know you both are right about pivot tables, however it will not work here. i guess i was not too clear on what i need. the code above is greatly appreciated, but changing the IB input, i guess i had to change more as now i get a error. thanks again.

  • Re: Save Monthly Data To New Workbook Named As Month


    This works perfect for me:

    don't forget to change the path, and remember that this is looking for the full month name not Jan but January, if you want to use Jan then remove one of the m's from

    Code
    If Application.WorksheetFunction.Text(MyCell, "mmmm") = IB Then

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!