+ Reply to Thread
Results 1 to 2 of 2

Copy rows of data that meet date range criteria to new sheet

  1. #1
    Registered User
    Join Date
    09-16-2015
    Location
    Victoria, BC, Canada
    MS-Off Ver
    2010
    Posts
    1

    Copy rows of data that meet date range criteria to new sheet

    Hi there,
    I have a macro that identifies all rows of data containing an expiry date effective today to 60 days from now, and copies those rows to a new worksheet. I want to filter all rows that contain an expiry date within an approximate two month range starting today. Unfortunately my code returns everything starting today and ignores part of the condition. I don't know if there is a problem with the date formatting though I've checked it. If there is a better way of coding this I would really love to know and all help is appreciated.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Copy rows of data that meet date range criteria to new sheet

    I would suggest you take the bits of code you are trying to compare and set them equal to a variable.

    Don't declare the data type, do as I did below.

    Use the locals window and step through the code and see what their values are and what data type they evaluate to.

    Please Login or Register  to view this content.
    Last edited by skywriter; 09-16-2015 at 10:01 PM.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

+ 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. Copy Rows that meet criteria to another workbook that contains all of them
    By TubbzUK in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-19-2013, 06:23 AM
  2. Replies: 5
    Last Post: 10-05-2012, 01:21 PM
  3. Replies: 4
    Last Post: 07-24-2012, 07:09 AM
  4. Cut rows that do not meet certain criteria to other sheet
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 29
    Last Post: 04-13-2011, 05:27 PM
  5. Copy Rows That Meet Given Criteria
    By BudParker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-06-2008, 05:00 PM
  6. Copy Rows In New Sheet Based On Date Range Criteria
    By ahmedwaseem2000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-10-2006, 05:45 AM
  7. Copy rows that meet a certain criteria
    By James in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-05-2006, 06:35 PM

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