+ Reply to Thread
Results 1 to 6 of 6

Filter 2 Dates and copy all visible data

  1. #1
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    729

    Filter 2 Dates and copy all visible data

    Hi Sir,

    In Date column i want to copy only that data which is select by user fromTo range of date
    E.g. "From 01-Mar-2019 to 13-Mar-2019"
    after filtered dates i want copy all the visible data and paste sheet2

    I also try below code but result showing totaly blank

    Please Login or Register  to view this content.

    Please find the attached file

    Please suggest me
    Attached Files Attached Files
    Last edited by mohan.r1980; 03-13-2019 at 07:42 AM. Reason: add code
    Regards,
    MohanS


    "Perfection is not attainable, but if we chase perfection we can catch excellence." - Vince Lombardi

    You can simply say thanks by clicking "*Add Reputation" icon

  2. #2
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: how do i Filter 2 Dates and copy all visible data

    Hello Mohan,

    You're getting a blank result because the dates in your sample are formatted as text. You'll need to change them to Excel dates. You can do this by using the Text to Columns feature in the ribbon:-

    - High-light the entire Column A.
    - In the ribbon, go to the Data tab and select Text to Columns.
    - In the dialogue box that appears, click on Next twice to go to the third page.
    - Click on Date then click on Finish.

    The format is now changed to Excel dates.
    You should now be able to filter them using your code.

    I hope that this helps.

    Cheerio,
    vcoolio.

  3. #3
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    729

    Re: how do i Filter 2 Dates and copy all visible data

    thanks for reply
    i do it and run the code but got blank result.

    when i record the macro then it works fine

    Please Login or Register  to view this content.
    and when i keep my variables then it shows me blank result

    Please Login or Register  to view this content.
    pls suggest

  4. #4
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: how do i Filter 2 Dates and copy all visible data

    Hello Mohan,

    I've attached your sample workbook with the following code implemented:-


    Please Login or Register  to view this content.
    I've changed the date formatting as described in post #2. You'll see that it all works as it should.
    You may have to change the ranges etc. to suit your actual workbook.

    I hope that this helps.

    Cheerio,
    vcoolio.
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    729

    Re: how do i Filter 2 Dates and copy all visible data

    Hi vcoolio,
    thanks for reply with solution and also sorry for late reply.
    your solution working fine

    pririor i have manage the code and it also works fine

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: how do i Filter 2 Dates and copy all visible data

    You're welcome Mohan.
    I'm glad to have been able to assist in some way.

    Cheerio,
    vcoolio.

+ 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 over sheets but visible cells only due to filter
    By eazy899 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-17-2018, 11:31 AM
  2. Filter range and copy selected column visible data and paste other sheet
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-19-2017, 11:37 AM
  3. [SOLVED] Filter data and copy visible cells based on criteria
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-11-2015, 06:04 AM
  4. [SOLVED] Copy Filter Data and paste it on another workbook with special cells(Only Visible Cells)
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-13-2014, 07:59 AM
  5. Macro to filter and copy visible data to a New Work Book
    By Mysore in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-15-2012, 11:44 PM
  6. Filter Data between 2 dates, copy, paste
    By humboldtguy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-02-2011, 10:17 PM
  7. Copy to Visible cells after filter
    By vandanavai in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-23-2009, 01:29 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