Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sort/Duplicate Help
Hello All, This is what I am trying to do. I am new at this and have been trying for a couple of weeks. Truck # Date Checked Engine # 36481 6/28/06 3cs26898 36498 6/26/06 3cs27391 36507 7/5/06 3cs27750 36526 6/26/06 3cs28760 36526 6/28/06 3cs28760 36539 6/26/06 3cs28972 36540 7/5/06 3cs28990 36550 6/28/06 3cs28983 36552 6/26/06 3cs28920 36553 6/28/06 3cs28921 36558 7/5/06 3cs28595 I want to sort column A then include B & C (expand selection) I think it says, then check for duplicate Truck #'s and delete or remove the duplicate truck # row. Hope this makes sense. Any help would be appreicated. Thx in advance James -- nascarjc ------------------------------------------------------------------------ nascarjc's Profile: http://www.excelforum.com/member.php...o&userid=31002 View this thread: http://www.excelforum.com/showthread...hreadid=559639 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sort/Duplicate Help
Sub FixData()
Dim lastrow as Long, i as Long Range(A:C).Sort Key1:=Range("A2"), _ Order1:=xlAscending, _ Header:=xlGuess, _ OrderCustom:=1, _ MatchCase:=False, _ Orientation:=xlTopToBottom lastrow = cells(rows.count,1).End(xlup).Row for i = lastrow - 1 to 2 step - 1 if cells(i,1) = cells(i+1,1) then rows(i).Delete end if Next End Sub Test it on a copy of your data. -- Regards, Tom Ogilvy "nascarjc" wrote in message ... Hello All, This is what I am trying to do. I am new at this and have been trying for a couple of weeks. Truck # Date Checked Engine # 36481 6/28/06 3cs26898 36498 6/26/06 3cs27391 36507 7/5/06 3cs27750 36526 6/26/06 3cs28760 36526 6/28/06 3cs28760 36539 6/26/06 3cs28972 36540 7/5/06 3cs28990 36550 6/28/06 3cs28983 36552 6/26/06 3cs28920 36553 6/28/06 3cs28921 36558 7/5/06 3cs28595 I want to sort column A then include B & C (expand selection) I think it says, then check for duplicate Truck #'s and delete or remove the duplicate truck # row. Hope this makes sense. Any help would be appreicated. Thx in advance James -- nascarjc ------------------------------------------------------------------------ nascarjc's Profile: http://www.excelforum.com/member.php...o&userid=31002 View this thread: http://www.excelforum.com/showthread...hreadid=559639 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sort/Duplicate Help
Hi Tom, Thanks for the help. I will give it a try and get back to you on ho it went. Jame -- nascarj ----------------------------------------------------------------------- nascarjc's Profile: http://www.excelforum.com/member.php...fo&userid=3100 View this thread: http://www.excelforum.com/showthread.php?threadid=55963 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sort/Duplicate Help
Hello Tom, I tried the code for the sort and works great and I like how it does it. One thing maybe I should have mentioned before also. When it deletes the duplicates, it erases all the codes I have in it. The page I am sorting and deleting the duplicates, it is copying data from another page. What you gave me though is great, I wish I could come up with code that fast. Thanks for your help it is much appreicated. If you need my codes I would gladly put it on also. James -- nascarjc ------------------------------------------------------------------------ nascarjc's Profile: http://www.excelforum.com/member.php...o&userid=31002 View this thread: http://www.excelforum.com/showthread...hreadid=559639 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Faster way to check and sort duplicate numbers | Excel Discussion (Misc queries) | |||
FIND AND SORT DUPLICATE TEXT | Excel Discussion (Misc queries) | |||
Automatically duplicate and sort data into seperate w.sheet | Excel Discussion (Misc queries) | |||
TRYING TO SORT OR FILTER DUPLICATE DATA | Excel Discussion (Misc queries) | |||
How can I sort duplicate text data in excel? | Excel Discussion (Misc queries) |