+ Reply to Thread
Results 1 to 3 of 3

Macro/code that finds most recent data based on condition and copies to another sheet

  1. #1
    Registered User
    Join Date
    02-07-2020
    Location
    Australia
    MS-Off Ver
    Excel
    Posts
    2

    Question Macro/code that finds most recent data based on condition and copies to another sheet

    Hello!

    I'm trying to create a macro that searches for the most recent data (should be either yesterday or today) and copies it to another sheet under "AM', "NOON", OR "PM". Alternatively, a piece of code that searches through data, identifies the most recent one, and places it in the right box. Currently this does what I want, but it only scans one line. How do I get it to scan through the three most recent entries (O33:O35) and pick out the AM one? Using the range in lieu of specific points didn't work.

    =IF(AND(TODAY()-1=$O$33, $P$33="AM"), $X$33, #N/A)
    Thank you!!

  2. #2
    Forum Moderator Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2010 on Linux
    Posts
    9,727

    Re: Macro/code that finds most recent data based on condition and copies to another sheet

    Administrative note

    Welcome to the forum

    in your haste to solve your problem, you probably missed the yellow banner advising how to get answers faster by posting a sheet ?

    Please take a moment to read it and attach a sheet accordingly.

    Thanks you for helping us help you
    You really don't have to give me rep points for moderating. It's part of the job. Keep rep points for those who find solutions

  3. #3
    Forum Moderator Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2010 on Linux
    Posts
    9,727

    Re: Macro/code that finds most recent data based on condition and copies to another sheet

    Administrative note
    Please update your profile as necessary to properly reflect the exact version(s) of Excel your question relates to. Members tailor answers based on your Excel version. Your profile does not indicate your version.
    Thanks

+ 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