Recently a friend asked me to fix a macro that she was working on to compare two columns in Excel and if the cell in Column A did not exist in any cell of Column B, then add it to Column C. You can make check both columns for miss matches by copy/pasting Column B to Column A and vice versa to check both lists and maybe someone will find it handy =) Sub Subset() Dim Acell As Range 'Acell is a range of 1 or more cells Dim Bcell As Range 'Bcell is a range of 1 or more cells Dim Ccell As Range 'Ccell is a range of 1 or more cells Dim Index As Integer 'Index is the current row we are saving to in the Ccell Index = 1 'Start the Index at 1 Dim found As Boolean 'Remove the hidden space 160 Range("A1:A1000").Replace What:=Chr(160), Replacement:="", LookAt:=xlPart Range("B1:B1000").Replace What:=Chr(160), Replacement:="", LookAt:=xlPart For Each Acell In Range("A1:A1000") Acell...
Comments
Post a Comment