+ Reply to Thread
Results 1 to 23 of 23

macro to move data from one sheet to another by month

  1. #1
    Forum Contributor
    Join Date
    09-28-2016
    Location
    Seattle, washington
    MS-Off Ver
    2016
    Posts
    330

    macro to move data from one sheet to another by month

    Hello, on the attached worksheet i'm trying to get the data from "Closed Business" to The "Executive" Sheet by month, when the Month is entered into cell J2, (I entered the first row in as an example) This would then save as "Closed Business for Distribution - October, 2016" , or whatever month is entered in J2, in a file to my desktop.

    Also this would be going to upper management so if you have any ideas on a way to make it more appealing to look at that would be great also. This is not important, was just looking for ideas if you have any.

    Thank you for any and all help.
    Attached Files Attached Files

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: macro to move data from one sheet to another by month

    Hi Steve

    Will the Data always be just one year or could there be a mix of Years in the Data?
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Forum Contributor
    Join Date
    09-28-2016
    Location
    Seattle, washington
    MS-Off Ver
    2016
    Posts
    330

    Re: macro to move data from one sheet to another by month

    Hi Jaslake, Thanks for your help again. It would be throughout the current year. then 2017 would be a new sheet.

  4. #4
    Forum Contributor
    Join Date
    09-28-2016
    Location
    Seattle, washington
    MS-Off Ver
    2016
    Posts
    330

    Re: macro to move data from one sheet to another by month

    Hello Jaslake, Any luck? I have a sheet that does something similar, but have no idea of how to tweak the code to work for this sheet? Thank you.

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: macro to move data from one sheet to another by month

    Hi Steve

    This Code is in the attached. It's fired by a change in Cell J2 (Month) of Sheet Executive.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    09-28-2016
    Location
    Seattle, washington
    MS-Off Ver
    2016
    Posts
    330

    Re: macro to move data from one sheet to another by month

    Thank you!, I will check it out in a little bit! Really appreciate your help!

  7. #7
    Forum Contributor
    Join Date
    09-28-2016
    Location
    Seattle, washington
    MS-Off Ver
    2016
    Posts
    330

    Re: macro to move data from one sheet to another by month

    Hello, I'm getting an error code when selecting in J2 - " run-time error '1004': Auto filter method of range class failed " ???

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: macro to move data from one sheet to another by month

    Hi Steve

    Somehow cell K2 has been reformatted to Date...change the format to General.

  9. #9
    Forum Contributor
    Join Date
    09-28-2016
    Location
    Seattle, washington
    MS-Off Ver
    2016
    Posts
    330

    Re: macro to move data from one sheet to another by month

    Got it! Thanks so very much for this, It works great! Have a great weekend!!

  10. #10
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: macro to move data from one sheet to another by month

    You're welcome...glad I could help. Thanks for the Rep.

  11. #11
    Forum Contributor
    Join Date
    09-28-2016
    Location
    Seattle, washington
    MS-Off Ver
    2016
    Posts
    330

    Re: macro to move data from one sheet to another by month

    Hello Again, If you have a Minute, can you explain how the "auto filter" works in this code? Thanks.

    .Range("A3:W" & srcLR).AutoFilter Field:=17, Operator:= _
    xlFilterValues, Criteria2:=Array(1, myDate)

  12. #12
    Forum Contributor
    Join Date
    09-28-2016
    Location
    Seattle, washington
    MS-Off Ver
    2016
    Posts
    330

    Re: macro to move data from one sheet to another by month

    Hello Jaslake, Don't worry about that last question, I looked it up and found some examples, and how they work. Have a good weekend.

  13. #13
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: macro to move data from one sheet to another by month

    OK...thanks for the heads up.

  14. #14
    Forum Contributor
    Join Date
    09-28-2016
    Location
    Seattle, washington
    MS-Off Ver
    2016
    Posts
    330

    Re: macro to move data from one sheet to another by month

    Hi Jaslake, How would i modify your code to border the cells when they move to the "executive tab"?? I cant figure it out. Thank you.

  15. #15
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: macro to move data from one sheet to another by month

    Hi Steve...show me what you've tried.

  16. #16
    Forum Contributor
    Join Date
    09-28-2016
    Location
    Seattle, washington
    MS-Off Ver
    2016
    Posts
    330

    Re: macro to move data from one sheet to another by month

    I tried changing .cells.borders.linestyle, taking out .borders. Also the .range (a8:j) .clear taking out .clear. Both to no good. Not sure where to go from here! Thank you for your time!

  17. #17
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: macro to move data from one sheet to another by month

    Hi Steve

    Going to bed...SHOW me what you've tried...this is not Code...
    I tried changing .cells.borders.linestyle, taking out .borders. Also the .range (a8:j) .clear taking out .clear. Both to no good.

  18. #18
    Forum Contributor
    Join Date
    09-28-2016
    Location
    Seattle, washington
    MS-Off Ver
    2016
    Posts
    330

    Re: macro to move data from one sheet to another by month

    Please Login or Register  to view this content.
    I think i got it working on another sheet i have been playing with - This does not delete the borders when selecting a new month, but it does not resize it to the number of rows when the month changes. What do you think?

  19. #19
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: macro to move data from one sheet to another by month

    Hi Steve

    I think this is LeoTaxi's code from your duplicate Thread...

    http://www.excelforum.com/excel-prog...h-entered.html

    If you wish it modified please ask LeoTaxi to look at it with you.

    Have you tried modifying the Code I provided?
    How would i modify your code to border the cells when they move to the "executive tab"?? I cant figure it out

  20. #20
    Forum Contributor
    Join Date
    09-28-2016
    Location
    Seattle, washington
    MS-Off Ver
    2016
    Posts
    330

    Re: macro to move data from one sheet to another by month

    Yes it was originally from Leo, I have tried to modify Yours but don't even know where to begin. I tried on the below part of the code taking out .clear, which did not work. I like the way the drop down selects the month and then imports the data on yours. So much to learn!

    Please Login or Register  to view this content.

  21. #21
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: macro to move data from one sheet to another by month

    Hi Steve

    Here is the Code I provided modified to add Borders...
    Please Login or Register  to view this content.

  22. #22
    Forum Contributor
    Join Date
    09-28-2016
    Location
    Seattle, washington
    MS-Off Ver
    2016
    Posts
    330

    Re: macro to move data from one sheet to another by month

    Ahhh, got it working. Thanks again, Was looking at that line that was replaced with the above "with tgtws" code, would never have came up with that!

  23. #23
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: macro to move data from one sheet to another by month

    You're welcome

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro to move data from one sheet to multiple sheet
    By sreejeshc in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-14-2015, 05:19 AM
  2. [SOLVED] Macro to move data from one sheet to another
    By cbrd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-31-2012, 09:18 PM
  3. Replies: 2
    Last Post: 10-09-2012, 04:40 PM
  4. [SOLVED] Macro to move data from one sheet to another
    By KMD1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-25-2012, 04:23 PM
  5. Move data from one sheet to another. Macro
    By chrispulliam in forum Excel General
    Replies: 3
    Last Post: 03-08-2011, 09:57 AM
  6. Write macro to move data to new sheets, depending on month
    By kealisa in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-24-2009, 06:51 PM
  7. Macro to move data from one sheet to another row by row
    By saus04 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-22-2008, 11:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1