+ Reply to Thread
Results 1 to 15 of 15

Sort data to separate sheets based on criteria

  1. #1
    Registered User
    Join Date
    10-09-2012
    Location
    Cambridge, MA
    MS-Off Ver
    Excel 2011
    Posts
    4

    Sort data to separate sheets based on criteria

    Hi everyone, I'm trying to make a macro that will sort my data to different sheets depending on certain criteria, specifically by date. I've attached the version I've been working on below. If anyone can help me construct a macro, or point me in the right direction, it would be much appreciated. Thanks!

    ReviewSorter.xls

  2. #2
    Registered User
    Join Date
    08-27-2012
    Location
    Omaha, NE
    MS-Off Ver
    Excel 2010
    Posts
    57

    Re: Sort data to separate sheets based on criteria

    Something like this should work for you, with possibly some changes I haven't tested it yet



    Please Login or Register  to view this content.
    Piggy

  3. #3
    Registered User
    Join Date
    10-09-2012
    Location
    Cambridge, MA
    MS-Off Ver
    Excel 2011
    Posts
    4

    Re: Sort data to separate sheets based on criteria

    Thanks so much for your reply, it's giving me a compile error, expected function or variable. What would be the best way to fix this?

  4. #4
    Registered User
    Join Date
    08-27-2012
    Location
    Omaha, NE
    MS-Off Ver
    Excel 2010
    Posts
    57

    Re: Sort data to separate sheets based on criteria

    my guess is, you'll have to make sure that the ".Value" and "9/26/2012" within the formula are disagreeing with eachother, I got the same thing. I would search google for using Dates in vba, as I haven't had any experience using dates, only values and strings.

  5. #5
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Sort data to separate sheets based on criteria

    You can use dates Like this

    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  6. #6
    Registered User
    Join Date
    10-09-2012
    Location
    Cambridge, MA
    MS-Off Ver
    Excel 2011
    Posts
    4

    Re: Sort data to separate sheets based on criteria

    Hi everyone, I changed the values to the date format, but it's still giving me the same error. I've attached a screenshot so you can see the text it's highlighting. Thanks!

    Screen shot 2012-10-11 at 3.09.21 PM.jpg

  7. #7
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Sort data to separate sheets based on criteria

    untested Modified code from post #2

    Please Login or Register  to view this content.
    Last edited by mike7952; 10-11-2012 at 04:35 PM.

  8. #8
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Sort data to separate sheets based on criteria

    Give this a try

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    10-09-2012
    Location
    Cambridge, MA
    MS-Off Ver
    Excel 2011
    Posts
    4

    Re: Sort data to separate sheets based on criteria

    Hi Mike, thanks for your help! When I run your code, excel gives me this error:Screen shot 2012-10-11 at 3.53.44 PM.png

  10. #10
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: Sort data to separate sheets based on criteria

    Try this - Tested version of post #2 and #7:

    Please Login or Register  to view this content.
    If solved kindly remember to mark Thread as solved.
    Click the small star icon at the bottom left of my post if this was useful.

  11. #11
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520
    Which code gives you the error? My solution in post #7? Did u test it on your uploaded workbook?

  12. #12
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Sort data to separate sheets based on criteria

    What Operating System are your using?

  13. #13
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Sort data to separate sheets based on criteria

    I have tested all the codes. None of them work execept Mike's dic(Post 8)

  14. #14
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: Sort data to separate sheets based on criteria

    This works for me...not sure what the issue could be.
    Attached Files Attached Files
    Last edited by kbkumar; 10-11-2012 at 05:02 PM. Reason: Attachment

  15. #15
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Sort data to separate sheets based on criteria

    Off to OP then

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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