I'm trying to write a macro that will compare and align 2 columns of data as part of an overall marco but iend up doing it manually.
I've included a simplified version that if i could work on it I could extrapolate to my file. In words this is what I'm trying to do:
Compare cell A2 to Cell C2:
If cell A2 = C2, move down to cell A3
If cell A2 does not equal C2, search for cell A2 in column C below C2 (this is needed when you go further down the sheet which you will see later). If it does not exist, insert cell on C2+D2 and shift everything down in these columns from row 2 down. (this is implying this cell is unique to Col A)
If cell A2 does not equal C2 and does not exist in column C, insert cell in A2+B2 and shift everything down in these 2 columns below row 2 (This is implying cell C2 is unique to Col C and is not in col A)
The macro will continue to work its way down until the end of Col A following the above rules.
One thing i need to maintain is the sequence of numbers in each column, its really important. I've included this in the example, even though some of the rows exist in both columns they are not in the right order.
As a final note I'd like to highlight cells that are different betweent he 2 compare columns (i.e. A and C in the example). This isn't critical as I can just do a conditional format that shows all blank cells in a column and the neighbouring cell will be the one of interest, but it would be a nice way of closing it.
Brendan
Bookmarks