+ Reply to Thread
Results 1 to 2 of 2

Sort data within past week

  1. #1
    Registered User
    Join Date
    12-09-2016
    Location
    Odense, Denmark
    MS-Off Ver
    MS 10
    Posts
    3

    Sort data within past week

    Hi people.

    I have a lot of data importet from Access.
    there is data in column A,B,C,D,E, and posting date in column F.

    How can i select and copy all rows (A to E) which are dated within the past 7 days into a new worksheet using VBA?

    Thanks in advance.

    Best regards.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Sort data within past week

    Hi,

    The simplest way would be to Autofilter the data and then copy the filtered rows and paste them to a second sheet.
    If you really want to do this with a macro then switch on the macro recorder, perform the Autofilter and the Copy Paste.

    If you've picked the 'Filter last week' option then the macro probably doesn't need any edititing, otherwise it may do to create variables for the week definition.

    Upload the workbook if you're still struggling when you've done that.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ 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. VBA, selecting specific row dated past 7 days (week)
    By thom2467 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-09-2016, 10:33 AM
  2. Copy and Past if cell equals X for each day of the week
    By chris vice in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-22-2016, 05:44 PM
  3. [SOLVED] Macro to Start New Sheet +Sort Past Data
    By Adam Schaefer in forum Excel General
    Replies: 1
    Last Post: 03-07-2015, 01:28 AM
  4. Data sort then sort of same value in descending days of the week
    By jimbob121 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-05-2014, 02:32 PM
  5. How do I update a graph weekly in excel without overwriting past week information
    By nconsola in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-19-2013, 02:11 PM
  6. Replies: 0
    Last Post: 04-23-2013, 05:35 AM

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