+ Reply to Thread
Results 1 to 1 of 1

Macro to sort an activity sheet by current week and current + last 1 and 2 weeks

  1. #1
    Registered User
    Join Date
    11-13-2011
    Location
    norway
    MS-Off Ver
    Excel 2010
    Posts
    1

    Macro to sort an activity sheet by current week and current + last 1 and 2 weeks

    Hi i have a sheet that looks like:

    Row 1 to 8 contains general info and macro buttons, so all data starts from row 9.
    In cell C2 i have todays date by =TODAY() as 13-nov-11
    In cell C3 i have current week by =INT((C2-DATE(YEAR(C2-WEEKDAY(C2-1)+4);1;3)+WEEKDAY(DATE(YEAR(C2-WEEKDAY(C2-1)+4);1;3))+5)/7)

    Column A have cut-off dates like 10.11.2011
    Column B have Week no. auto from formula: =IF(ISBLANK(A9);"";INT((A9-DATE(YEAR(A9-WEEKDAY(A9-1)+4);1;3)+WEEKDAY(DATE(YEAR(A9-WEEKDAY(A9-1)+4);1;3))+5)/7))
    Column C have disciplines like Mech, process, automation etc from a data validation list
    Column D have activities this week
    Column E have activities expected next week

    I have 3 macro buttons that i want to filter:
    Button 1: Show only current week + top rows 1-8
    Button 2: same as above + current week -1 (aka current + last week)
    Button 3: Same as above + current wwek -1 + current week 2 (aka current + last two weeks)

    Also the code must differentiate between different years since activity will be 2-3 years long

    I have this code to show current week but it dont show row 1 to 8 and it seems to have flaws since it shows not only current
    Please Login or Register  to view this content.
    Is there some who can help me getting these 3 buttons to work as intended? thanks
    Last edited by pike; 11-14-2011 at 01:51 AM. Reason: add code tags for newbie

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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