Complex Compare Values, and Copy/Paste if in One Sheet but Not Oth

R

ryguy7272

I am looking for a way of testing values, in Column A, on two sheets. I have
a sheet named ‘Analysis of Interest Current’ and ‘Analysis’. I know
‘Analysis of Interest Current’ has 7 numbers that ‘Analysis’ does not have;
these are account numbers. I want to test the values in these two sheets,
and if a number exists on ‘Analysis of Interest Current’ but not on
‘Analysis’, then I want to copy the row and insert it, in chronological
order, into ‘Analysis’; insert the whole row in the cell below.

For instance, I have account number 7200-0147 (just a number; no text in the
cell) in ‘Analysis of Interest Current’. I know this account is not in
‘Analysis’, but I do have account 7200-0146 in ‘Analysis’. Basically, I
wanted to copy/paste the row with 7200-0147 below the row with 7200-0146.

I’m sure it can be done, but not sure how difficult it is. Does anyone here
have such a macro, or similar code that is easily modified to do what I
described above? If so, please share.

TIA!!!
Ryan---
 
S

Sam Wilson

If the two columns are sorted then you can use a simple loop I think...

if .offset(i,0) in one sheet is equal to .offset(i,0) in the other then do
nothing. If it's not then because both columns are sorted you can insert the
row from the 'lesser' value in before the row with the 'greater' value, and
then move to the next loop.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top