Comparing cells

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

-I have 2,000 records in my sheet. Column A has my Model#, Col B has my List
Price, Col C has the Supplier Model#, Col D has the Supplier New List Price.
--I carry only 1,000 of the Supplier's items.
---I want to run through Col C and find the matching record (if there is
one) in Col A and line up the matching records.
----Can anyone help?
 
You want to insert "rows" in Columns A and B so they line up with column C?

Each set of data is sorted?

If so


Sub srt()
r = 2
Do While Cells(r, "A") <> "" And Cells(r, "C") <> ""
If Cells(r, "A") = Cells(r, "C") Then
Else
If Cells(r, "A") < Cells(r, "C") Then
Cells(r, "C").Resize(1, 2).Select
Selection.Insert Shift:=xlDown
Else
Cells(r, "A").Resize(1, 2).Select
Selection.Insert Shift:=xlDown
End If
End If
r = r + 1
Loop
End Sub

will do it I believe.
 
Tom, this worked well. Thank you, I greatly appreciate your help. Dan Belanger.
 

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

Back
Top