+ Reply to Thread
Results 1 to 9 of 9

Filter and copy

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Filter and copy

    Hello:

    I have data in sheet1 (from Row 6 onwards)Column A thru F with
    Column A is YEAR (Example : 2001,2002, etc)
    Column B is Date (Example : 12/11/2001, etc)
    Column C thru F other data.

    Sheet 2: Cell A1 would have drop down list of years from 2001 thru 2013

    I need VB Macro to copy all data from Sheet1 to Sheet2 (statring in Row6) for a year value from Sheet2 Cell A1.


    Please let me know if any questions.

    Thank you

    Riz Momin
    Last edited by rizmomin; 06-08-2013 at 08:06 AM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Filter and copy

    Hi Riz,

    Here is a sample that I think you can expand on.
    This example uses a Dynamic Named Range on Sheet1.
    It then does an Advanced Filter on Sheet 2
    That is triggered by changing the number in cell A1 on sheet 2.

    See if it isn't what you are looking for.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Filter and copy

    Hi Marvin:

    Excellent, this will work for me.

    Thank you so much for your great help.

    Riz Momin

  4. #4
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Filter and copy

    Hi: Marvin

    How do i define my data in the code.

    Please help.

    Thank you

    Riz Momin

  5. #5
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Filter and copy

    Hi Marvin:

    Please refer to my attached sheet and see if you help.

    Thank you

    Riz Momin
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Filter and copy

    Riz,
    Try the attached. The code will be triggered by changing the value of A1.
    I make certain assumptions:

    You want to clear the existing data before you copy the new data, but if you do not want that, i.e. if you want to copy in to next empty cell, please comment the line which clears data.
    Please Login or Register  to view this content.
    I am not sure if you also want to delete the copied data once they are copied in to filter sheet. I have commented a line (Green line). If you want it, you can uncomment it and data will be deleted from sheet1.
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Filter and copy

    Hi AB33:

    This works perfectly with my data.
    Thank you so much for your great help.

    Riz Momin

  8. #8
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Filter and copy

    Hi AB33:

    This works perfectly with my data.
    Thank you so much for your great help.

    Riz Momin

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Filter and copy

    Riz,
    You are always welcome!

+ 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