+ Reply to Thread
Results 1 to 3 of 3

Matching Data on different cells

  1. #1
    born2jam4ever
    Guest

    Matching Data on different cells

    Hello,

    I have been working on creating a data matching program that takes two
    worksheets and compares one against the other. That is Each row in Sheet1 is
    compared against All rows in Sheet2 and when a match is found a redirect
    occurs to another page. For some reason when I run the "comparing" portion of
    the code it appears to lock up with the little white window in the title bar.
    However if you wait long enough it seems most of the time it does completely
    finish. Normally if this problem does not occur it displays row by row each
    match found that is redirected.

    Ever heard of this before?

    Thanks,



  2. #2
    Anne Troy
    Guest

    Re: Matching Data on different cells

    If you want people to help troubleshoot your code, you'd better post it.
    *******************
    ~Anne Troy

    www.OfficeArticles.com


    "born2jam4ever" <born2jam4ever@discussions.microsoft.com> wrote in message
    news:BB7B7D12-0B7F-4DFE-B487-90C20DE5BA57@microsoft.com...
    > Hello,
    >
    > I have been working on creating a data matching program that takes

    two
    > worksheets and compares one against the other. That is Each row in Sheet1

    is
    > compared against All rows in Sheet2 and when a match is found a redirect
    > occurs to another page. For some reason when I run the "comparing" portion

    of
    > the code it appears to lock up with the little white window in the title

    bar.
    > However if you wait long enough it seems most of the time it does

    completely
    > finish. Normally if this problem does not occur it displays row by row

    each
    > match found that is redirected.
    >
    > Ever heard of this before?
    >
    > Thanks,
    >
    >




  3. #3
    born2jam4ever
    Guest

    Re: Matching Data on different cells

    Thank You,

    Here is an example of what it is doing. For each row it compared
    multiple cells using a nested control structure with For..Next. The amount of
    rows on each page is calculated in a formula ahead of time that the code
    reads. i & r being the values. and counter representing the last row on the
    output_sheet that was pasted on.


    Dim counter, i, r
    counter = 1

    For i = 2 To Excel.Worksheets("Program").Cells(2, 2).Value

    For r = 2 To Excel.Worksheets("Program").Cells(2, 3).Value

    If Excel.Worksheets("Extract1").Cells(r, 8).Value =
    Excel.Worksheets("Extract2").Cells(i, 8).Value And _
    Excel.Worksheets("Extract1").Cells(r, 10).Value =
    Excel.Worksheets("Extract2").Cells(i, 10).Value And _
    Excel.Worksheets("Extract1").Cells(r, 14).Value =
    Excel.Worksheets("Extract2").Cells(i, 14).Value And _
    Excel.Worksheets("Extract1").Cells(r, 16).Value =
    Excel.Worksheets("Extract2").Cells(i, 16).Value Then

    Excel.Worksheets("Extract1").Cells(r, 1).EntireRow.Copy
    Excel.Worksheets("OutputSheet").Rows(counter).PasteSpecial
    counter = counter + 1

    End If

    Next

    Next

    "Anne Troy" wrote:

    > If you want people to help troubleshoot your code, you'd better post it.
    > *******************
    > ~Anne Troy
    >
    > www.OfficeArticles.com
    >
    >
    > "born2jam4ever" <born2jam4ever@discussions.microsoft.com> wrote in message
    > news:BB7B7D12-0B7F-4DFE-B487-90C20DE5BA57@microsoft.com...
    > > Hello,
    > >
    > > I have been working on creating a data matching program that takes

    > two
    > > worksheets and compares one against the other. That is Each row in Sheet1

    > is
    > > compared against All rows in Sheet2 and when a match is found a redirect
    > > occurs to another page. For some reason when I run the "comparing" portion

    > of
    > > the code it appears to lock up with the little white window in the title

    > bar.
    > > However if you wait long enough it seems most of the time it does

    > completely
    > > finish. Normally if this problem does not occur it displays row by row

    > each
    > > match found that is redirected.
    > >
    > > Ever heard of this before?
    > >
    > > Thanks,
    > >
    > >

    >
    >
    >


+ 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