Results 1 to 7 of 7

Macro- Search multiple criteria in spreadsheet return with multiple results in new sheet

Threaded View

nicebeaches Macro- Search multiple... 01-21-2018, 11:44 PM
leelnich Re: Macro- Search multiple... 01-22-2018, 03:08 AM
leelnich Re: Macro- Search multiple... 01-22-2018, 06:12 AM
nicebeaches Thank you so very much! The... 01-22-2018, 01:59 PM
jindon Re: Macro- Search multiple... 01-22-2018, 07:05 AM
nicebeaches Thank you thank you!! I can’t... 01-22-2018, 02:01 PM
leelnich Re: Macro- Search multiple... 01-22-2018, 04:47 PM
  1. #1
    Registered User
    Join Date
    01-21-2018
    Location
    Chicago, Illinois-*88888888888888888888
    MS-Off Ver
    2013
    Posts
    4

    Macro- Search multiple criteria in spreadsheet return with multiple results in new sheet

    Greetings,

    Hope someone can assist. I have two large set of data, 20,000 lines in each of accounts and security names. Need to find all the rows that have matching accounts and names listed in spreadsheet 1(Detail) and search in sheet2() then copy the row containing the asset information into a new spreadsheet. I should have multiple results with the same asset name but in different accounts.I'd like use

    Select name(column E until Final row) in Sheet 1 (Detail)
    Search Asset name in sheet2 for asset and matching account number
    If the asset and account number both match, copy the entire row into sheet 3

    I stat

    Sub search_and_extract()
    'Find records that match criteria and paste to the report sheet

    Dim Nir As Worksheet
    Dim Detail As Worksheet 'pull asset and account search in Nir worksheet
    Dim reportsheet As Worksheet 'where data will be copied
    Dim Assetname As String
    Dim Accountnumber As String
    Dim finalrow As Integer
    Dim i As Integer 'row counter

    'Set variables
    Set Detail = Sheet1
    Set Nir= Sheet2
    Set reportsheet = Sheet3

    Assetname = Sheets("Detail").Range(E2).Value 'E2 is the cell containing the asset name to search- go until the last row

    For i = 2 To finalrow
    If Cells(i, 1) = Assetname Then
    Range(Cells(i, 2), Cells(i, 28)).Copy
    finalrow.End(xlUp).Offset(1, 0).PasteSpecialxlpasteformulasnumber
    Last edited by nicebeaches; 01-22-2018 at 10:45 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Multiple search criteria to return multiple results
    By johnmacs5 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-01-2016, 05:17 PM
  2. Replies: 1
    Last Post: 12-14-2015, 07:10 PM
  3. Replies: 6
    Last Post: 08-22-2014, 08:47 AM
  4. Multiple Search Criteria produces (list) Multiple results in a single cell
    By snake007uk in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-02-2014, 12:13 PM
  5. Search Workbook for cells that meet multiple criteria and return results from rows
    By CFritz7 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-27-2013, 04:41 PM
  6. Search multiple sheets and return list of multiple results
    By Abuck in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 03-07-2012, 11:59 AM
  7. User Form to Search multiple Criteria to return multiple Results
    By Calieth in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-16-2011, 11:57 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