![]() Here, I want to find the matches of the Email_ID column. ![]() To compare two columns and to find matches you can use the VBA Macro as well. Using Macro to Find Matches Comparing Two Columns Related Content: Excel formula to compare two columns and return a value (5 examples) 2. Here both columns unique values are Highlighted. Hence, it will Highlight all the unique values of two-column.Īgain, you can run the Macro to compare Addresses. Now, from the Macro name select the Highlighting_Comparing_2Columns also select the workbook within Macros in. Next, open the View tab > from Macros > select View Macros Then, select the cell range to apply the VBA Then, if the compared value is unique by row, then it will Highlight it with Yellow color as I used ColorIndex = 6.įinally, Save the code and go back to the worksheet. I used an IF statement to compare the values of the selected cell range, also I used a FOR loop to check all the rows. Here, I declared the Sub procedure Highlighting_Comparing_2Columns where Twocolumns is Range type and i is Integer type variables. Next, it will open Microsoft Visual Basic for Applications.įrom there, open Insert > select Module.Ī Module will open then type the following code in the opened Module. You also can use the ALT + F11 keyboard to open the VBA editor. Now, open the Developer tab > select Visual Basic To do it I will take the same type of columns together. Using Macro to Highlight Unique Values Comparing Two Columnsīy using VBA Macro, you can Highlight the Unique values of two columns. 4 Ways to Use Excel Macro to Compare Two Columns 1.
0 Comments
Leave a Reply. |