[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More
Experts Exchange Solution brought to you by
"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.
Dim i As Integer, r As Long, lr As Long, lc1 As Long, lc2 As Long, j As Long
Dim ws1 As Worksheet, ws2 As Worksheet
Dim strSh As String, strRow As String, str1 As String, str2 As String, strMatch As String
Dim x, y, Result()
Application.ScreenUpdating = False
For i = 1 To 7 Step 2
Set ws1 = Sheets(i)
Set ws2 = Sheets(i + 1)
lr = ws1.Cells(Rows.Count, 1).End(xlUp).Row
ReDim Result(1 To lr, 1 To 3)
For r = 1 To lr
lc1 = ws1.Cells(r, Columns.Count).End(xlToLeft).Column
lc2 = ws2.Cells(r, Columns.Count).End(xlToLeft).Column
x = ws1.Range("A" & r, ws1.Cells(r, lc1)).Value
y = ws2.Range("A" & r, ws2.Cells(r, lc2)).Value
If IsArray(x) Then
str1 = Join(Application.Index(x, 1, 0), ",")
str1 = x
If IsArray(y) Then
str2 = Join(Application.Index(y, 1, 0), ",")
str2 = y
If str1 = str2 Then
strMatch = "True"
strMatch = "False"
Result(r, 1) = ws1.Name & " - " & ws2.Name
Result(r, 2) = "Row" & r
Result(r, 3) = strMatch
Range("B" & Rows.Count).End(3)(2).Resize(UBound(Result, 1), 3).Value = Result
Application.ScreenUpdating = True
Open in new window
Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.