I am currently looking to compare multiple Ranges in a specific order using VBA. The condition is to take Column A, compare it and identify matches within Column B. The specified adjacent cell to the left/right of the identified matches in column B, will then be considered column C, then compared and matched with column D. Finally the left/right adjacent cell to the identified matches in column D will be copied and pasted to a specified range in a separate sheet.
Snip01 https://1drv.ms/u/s!Ar3kJS7jPDiLgoh6QM6ZnFl_sjuZZQ
Snip02 https://1drv.ms/u/s!Ar3kJS7jPDiLgoh5zm1b2BozaT-0iw
Snip03 https://1drv.ms/u/s!Ar3kJS7jPDiLgoh4Ane8V1jZfoxbCA
Snip04 https://1drv.ms/u/s!Ar3kJS7jPDiLgoh3enh0OIUJ3m6BDA
Currently this is all I have written in VBA, and as you can probably tell, I am absolutely lost.
Sub MatchIt() Dim Atlas As Range Dim Atlas2 As Range Dim Roster As Range Dim Roster2 As Range Dim Push As Range Set Atlas = Range("D2") Set Atlas2 = Range("M2") Set Roster = Range("T2") Set Roster2 = Range("S2") Set Push = Range("AB2") For Each cell In Push If Push.Value = Roster2.Value Then End Sub
I am mostly getting stumped on how to specify a cell relative to a previous result (hopefully I'm wording this correctly). I would appreciate any help with this. Thank you.
2.1m questions
2.1m answers
60 comments
57.0k users