+ 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 Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,443

    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

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,443

    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)

Similar Threads

  1. Search box which finds all instances of input keyword, copies and pastes into one sheet
    By ManateeProfanity in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-05-2019, 08:17 AM
  2. [SOLVED] Macro that copies a formula to another sheet and copies data at same time
    By Newbienewbster0932 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-26-2017, 02:49 PM
  3. VBA code that finds data based on criteria, moves up two rows, copies cell to new sheet
    By Excelsior12 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-31-2016, 05:47 PM
  4. Help: Need macro that copies formula based on condition
    By sudric in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-06-2014, 01:44 PM
  5. Need Help Creating a Macro That Finds New Data and Copies it to Another Cell
    By fly91 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-16-2013, 09:14 PM
  6. Replies: 2
    Last Post: 05-01-2013, 12:26 PM
  7. [SOLVED] Customize code for a macro that copies three rows to a new workbook based on a condition
    By philips in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 01-04-2013, 05:55 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