+ Reply to Thread
Results 1 to 12 of 12

Filter Based on Time Criteria and Copy to New Sheet

  1. #1
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Filter Based on Time Criteria and Copy to New Sheet

    Hi,

    Can anyone help me to Filter time based on Clock In and Clock Out criteria and copy the filtered data to a new sheet.

    First, if Clock In is Blank and time is > 08:15

    Second, if Clock out is Blank & time is < 17:15

    I have attached the Sample Worksheet.

    Regards
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Filter Based on Time Criteria and Copy to New Sheet

    Do you mean...

    First, if Clock In is Blank and Clock Out time is > 08:15

    Second, if Clock out is Blank & Clock In time is < 17:15

    If yes, your example doesn't have any rows where Clock In is Blank and Clock Out is not blank.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Re: Filter Based on Time Criteria and Copy to New Sheet

    Yes, Column E (Clock In) where it is Empty and Time is > 08:15 and Column F (Clock Out) where it is Empty and Time is < 17:15

  4. #4
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Re: Filter Based on Time Criteria and Copy to New Sheet

    Hi

    Is there a solution for this thread?

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Filter Based on Time Criteria and Copy to New Sheet

    Does this help?

    Please Login or Register  to view this content.

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Filter Based on Time Criteria and Copy to New Sheet

    This copies the filtered data to sheets Sheet2 and Sheet3.

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Re: Filter Based on Time Criteria and Copy to New Sheet

    Dear John & Alpha

    Thanks for the code, but it is not giving the expected result when I run the macro. I have attached the worksheet with expected results in Sheets ("After").
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Filter Based on Time Criteria and Copy to New Sheet

    Lines 14, 15 and 16 on your After sheet do not meet the logic you requested? What's the rule for those?

    Maybe:

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507
    Quote Originally Posted by JOHN H. DAVIS View Post
    Lines 14, 15 and 16 on your After sheet do not meet the logic you requested? What's the rule for those?

    Maybe:

    Please Login or Register  to view this content.

    I will go through it on Saturday, at present I am out of office

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Filter Based on Time Criteria and Copy to New Sheet

    Sucuri doesn't accept the code to upload here, so try the attached.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Re: Filter Based on Time Criteria and Copy to New Sheet

    Thanks Jindon, Sorry due to weekend here I could not reply. Perfect result as expected. Special thanks to John and Alpha, I will mark this thread solved.

  12. #12
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Filter Based on Time Criteria and Copy to New Sheet

    You're welcome. Glad to help out and thanks for the feedback.

+ 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. [SOLVED] Copy specific column data from one sheet to another sheet using Certain filter Criteria
    By xlhelp7 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-02-2017, 12:09 AM
  2. [SOLVED] Advanced Filter Criteria; Copy to another sheet
    By brucemc777 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-29-2016, 07:54 PM
  3. Filter, Copy, Paste in a new sheet and give heading based on criteria
    By saravanan1981 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-12-2016, 09:54 AM
  4. Filter criteria based on time interval
    By Anuru in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 09-03-2016, 12:14 PM
  5. [SOLVED] Filter and Copy Rows based on chosen Criteria
    By Excel_Learner_08 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-29-2016, 11:40 AM
  6. filter data based on criteria and copy to another sheet
    By anbarasi_r in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-23-2015, 09:56 PM
  7. [SOLVED] Copy Based Criteria Filter
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-09-2014, 11:56 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