LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro for aligning duplicates in XL97

Hi everyone,
I'm looking for some help with aligning the duplicates in two lists. I have
a list of reference numbers (call them A,B,C,D,E,F,G,H) in one column and a
sub set of them (say C,E,G) in another column. I need C in column 1 to be on
the same row as C in column 2, E matching E etc and blank cells in between.
Any ideas?

I've been playing with the following code which I took from a duplicate
deletion macro on support.microsoft.com and have tried to make work, but I'm
getting nowhere.

Sub DelDups_TwoLists()
Dim iListCount As Integer
Dim iCtr As Integer

' Get count of records to search through (list that will be deleted).
iListCount = Sheets("sheet1").Range("H1:H100").Rows.Count

' Loop through the "master" list.
For Each x In Sheets("Sheet1").Range("A1:A100")
' Loop through all records in the second list.
For iCtr = 1 To iListCount
' Do comparison of next record.
' To specify a different column, change 1 to the column number.
If x.Value < Sheets("Sheet1").Cells(iCtr, 8).Value Then
' If match is true then delete row.
Sheets("Sheet1").Cells(iCtr, 8).Insert Shift:=xlDown
End If
Next iCtr
Next
MsgBox "Done!"
End Sub


Thanks very much
-Mike
www.trickswithhats.org


 
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
Macro to find duplicates Emece Excel Discussion (Misc queries) 4 February 9th 09 06:42 PM
Matching and Aligning Cells Formula/Function? Macro? [email protected] Excel Worksheet Functions 1 July 6th 06 06:19 AM
Aligning decimal numers to the centre of the cell and aligning dec Ramesh Babu Excel Discussion (Misc queries) 1 July 1st 06 10:33 PM
Checkcell macro problem XL97 Slagmendoza Excel Programming 2 August 10th 05 01:16 PM
Macro created in XL2000 not working in XL97 Shetty Excel Programming 6 May 27th 04 03:01 PM


All times are GMT +1. The time now is 06:59 PM.

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

About Us

"It's about Microsoft Excel"