Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing Cells basic Excel Discussion (Misc queries) 1 August 20th 09 08:37 PM
Comparing cells Browny Excel Discussion (Misc queries) 7 August 18th 08 05:41 AM
Comparing Cells gdeleos Excel Worksheet Functions 2 March 16th 06 08:22 PM
Comparing Cells EXCEL101 Excel Worksheet Functions 3 August 30th 05 12:51 AM
Comparing cells No Name Excel Programming 1 October 20th 04 06:21 PM


All times are GMT +1. The time now is 05:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"