[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 ws1 As Worksheet, ws2 As Worksheet, ws3 As Worksheet
Dim lr As Long, lc As Long, i As Long
Dim x, y, z(), dict
Dim str As String
Application.ScreenUpdating = False
Set ws1 = Sheets("Sheet1")
Set ws2 = Sheets("Sheet2")
Set ws3 = Sheets("Sheet3")
Set dict = CreateObject("Scripting.Dictionary")
lr = ws2.Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To lr
lc = ws2.Cells(i, Columns.Count).End(xlToLeft).Column
y = ws2.Range("A" & i, ws2.Cells(i, lc)).Value
str = Join(Application.Index(y, 1, 0), ",")
dict.Item(str) = ""
lr = ws1.Cells(Rows.Count, 1).End(xlUp).Row
ReDim z(1 To lr, 1 To 1)
For i = 1 To lr
lc = ws1.Cells(i, Columns.Count).End(xlToLeft).Column
x = ws1.Range("A" & i, ws1.Cells(i, lc)).Value
str = Join(Application.Index(x, 1, 0), ",")
If dict.exists(str) Then
z(i, 1) = "True"
z(i, 1) = "False"
ws3.Range("D1").Resize(lr, 1).Value = z
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.