+ Reply to Thread
Results 1 to 3 of 3

macro to search and list data

Hybrid View

  1. #1
    Rich
    Guest

    macro to search and list data

    is their a macro that will look threw a page of data and report on another
    page a list of results based on information in a percific col

    colums A to I contain data

    want to search col G and do a report on every event that does not contain
    "specific text", the report should contain all the data shown on "Data Page"
    rows that does not meet the "specific text"

    thanks in advance

  2. #2
    Don Guillett
    Guest

    Re: macro to search and list data

    To get you started look in the vba help index for FIND and then FINDNEXT.
    good example given.

    --
    Don Guillett
    SalesAid Software
    dguillett1@austin.rr.com
    "Rich" <Rich@discussions.microsoft.com> wrote in message
    news:529EA644-D76E-4AA7-A7A3-BAD4E97DD073@microsoft.com...
    > is their a macro that will look threw a page of data and report on another
    > page a list of results based on information in a percific col
    >
    > colums A to I contain data
    >
    > want to search col G and do a report on every event that does not contain
    > "specific text", the report should contain all the data shown on "Data
    > Page"
    > rows that does not meet the "specific text"
    >
    > thanks in advance




  3. #3
    Robert
    Guest

    RE: macro to search and list data

    This code (adapted from codes provided in this ng) should work (I do not
    know VBA).
    The selection criteria is entered in a named range “Salesman” in sheet SALES.
    From your active sheet containing the data run the following
    Macro which will copy the entire row to the target sheet (SALES)

    Sub CopySales()
    Dim ws As Worksheet
    Dim cLastRow As Long
    Dim i As Long
    Dim j As Long

    Set ws = ActiveSheet
    cLastRow = ws.Cells(Rows.Count, "B").End(xlUp).Row
    On Error Resume Next
    On Error GoTo 0
    j = 1
    For i = 1 To cLastRow
    If ws.Cells(i, "B").Value = Range("Salesman").Value Then
    ws.Cells(i, "B").EntireRow.Copy _
    Destination:=Worksheets("Sales").Cells(j + 9, "A")
    j = j + 1
    End If
    Next i

    End Sub

    --
    Robert




+ 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