Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Comparing cells
-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? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Comparing cells
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. -- Regards, Tom Ogilvy "Dan" wrote in message ... -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? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Comparing cells
Tom, this worked well. Thank you, I greatly appreciate your help. Dan Belanger.
"Tom Ogilvy" wrote: 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. -- Regards, Tom Ogilvy "Dan" wrote in message ... -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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Comparing Cells | Excel Discussion (Misc queries) | |||
Comparing cells | Excel Discussion (Misc queries) | |||
Comparing Cells | Excel Worksheet Functions | |||
Comparing Cells | Excel Worksheet Functions | |||
Comparing cells | Excel Programming |