+ Reply to Thread
Results 1 to 4 of 4

VBA Multi-Column Filter, Copy and Paste on Separate Sheet

  1. #1
    Registered User
    Join Date
    01-22-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    11

    VBA Multi-Column Filter, Copy and Paste on Separate Sheet

    Hi,

    Please advise on VBA code for the following, I've had trouble finding similar threads...

    Sheet1
    Column A = Acquisition Date (A1 = "Acquisition Date" Header)
    Column B = Buyer Name (B1 = "Buyers" Header)
    Column C = Seller Name (C1 = "Sellers" Header)

    Sheet2
    Cell A1 = "Linn Energy" (this cell is a variable where the user can input a buyer or seller name manually)

    The VBA macro will find the all the rows where either Sheet1.ColumnB = Sheet2.A1 or Sheet1.ColumnC = Sheet2.A1 and then paste those rows into Sheet2 starting in row 3 (2 rows underneath the input Cell A1)

    It is essentially filtering the table in Sheet1 and outputing the matching rows into Sheet2

    Appreciate any guidance. Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: VBA Multi-Column Filter, Copy and Paste on Separate Sheet

    see attched file AMJ 14122.xlsm
    save the file in your computer and open and ENABLE MACROS

    sample data is in sheet1
    in sheet 2 in cell A1 type any name in col 2 or 3 in sheet1.(if you type anything else a msg will appear that this name is not available)
    do not delete entry in A1 of sheet2 overwrite
    if the same value has to be added either type same value and enter or hit function F2 and hit enter key

    the code is an EVENT CODE. It should NOT be copied in a standard module
    if you RIGHT CLICK the tab of SHEET2 and click VIEW CODE you see the code
    as this is already in the vbeditor of the file you do not any thing except CHANGING the value in A1 of sheet2

    the code is also repeated here for others


    Please Login or Register  to view this content.
    I am not an expert. better solutions may be available
    [email protected]

  3. #3
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: VBA Multi-Column Filter, Copy and Paste on Separate Sheet

    see attached file AMJ 14122.xlsm
    save the file in your computer and open and ENABLE MACROS

    sample data is in sheet1
    in sheet 2 in cell A1 type any name in col 2 or 3 in sheet1.(if you type anything else a msg will appear that this name is not available)
    do not delete entry in A1 of sheet2 overwrite
    if the same value has to be added either type same value and enter or hit function F2 and hit enter key

    the code is an EVENT CODE. It should NOT be copied in a standard module
    if you RIGHT CLICK the tab of SHEET2 and click VIEW CODE you see the code
    as this is already in the vbeditor of the file you do not any thing except CHANGING the value in A1 of sheet2

    the code is also repeated here for others


    Please Login or Register  to view this content.
    Attached Files Attached Files

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

    Re: VBA Multi-Column Filter, Copy and Paste on Separate Sheet

    Maybe:

    Please Login or Register  to view this content.

+ 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. Loop through an existing filter and copy and paste content into separate workbook
    By moyay4 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-21-2014, 11:39 AM
  2. Replies: 5
    Last Post: 07-31-2013, 08:21 AM
  3. [SOLVED] Need: filter, paste info to new sheet, rename sheet, unfilter, hide column, filter next
    By esmithqg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2012, 04:49 PM
  4. Macro to filter based on column heading then copy and paste to new sheet
    By macattackr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-01-2012, 05:14 PM
  5. Separate data into another sheet applying Filter in a column
    By acsishere in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2011, 03:57 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