Loop Through Range 2 ranges

realniceguy5000

Board Regular
Joined
Aug 19, 2008
Messages
148
Hi, I need some help. I have 2 worksheets I need to check. i need to loop through sheet1 column a, find same value on sheet2 column a then somehow loop through each column on sheet1 same row and check the row that was found on sheet2 each column to make sure they match if they dont match then I need to mark the cells on both sheets and continue checking the values accross the entire row. Once done checking if they dont match move the rows to sheet3

Here is what I came up with so far but I am stuck.


Thanks for any help

Code:
Sub ColumnChecks()
colcount = 1
    With Sheets(1)
        Lrow1 = .Cells(Rows.Count, 1).End(xlUp).Row
        Lcol1 = .Cells(1, 256).End(xlToLeft).Column
            For x = Lrow1 To 2 Step -1
                For y = 1 To Lcol1
                    '.Cells(x, y).Select
                    Set c = .Cells(x, y)
                        With Sheets(2)
                            .Select
                               Set cfind = .Columns(1).Cells.Find(what:=c.Value, lookat:=xlWhole)
                               
 'not sure what now as I found the row on the 2 sheet but have to loop through values on the first sheet and loop
                                ' through this row on the 2nd sheet
                                
                                                  
                        
                        
                        
                        End With
                Next y
            Next x
    
    
    End With
    
End Sub
 
Oh I just thought of something. sometimes I have more Data in one of the worksheets so the rows dont always match up. I think that is what I meant when I said I need to find the matching row on sheet2 before I start the loop. Can you think of anyway around that?

Thank You Again...
 
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
can you upload your file any sharing site and paste that link here ?
 
Upvote 0
sorry but from that site i am unable to download any file or not able reply and post there or cant post new thread i dont know why

you mail me that file i am giving my mail in pm check your pm
 
Upvote 0

Forum statistics

Threads
1,215,172
Messages
6,123,443
Members
449,100
Latest member
sktz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top