ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Matching Data on different cells (https://www.excelbanter.com/excel-programming/334744-matching-data-different-cells.html)

born2jam4ever

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,



Anne Troy[_2_]

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" wrote in message
...
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,





born2jam4ever

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).Past eSpecial
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" wrote in message
...
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,







All times are GMT +1. The time now is 06:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com