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 Comparing lists

Hi,
Any help would be greatly appreciated.

I have two lists, old and new. I used the conditional formatting in
Excel to highlight and bold those in Old that do not appear in New, and
those in New that do not appear in old.

Now, I have two listboxes, one entitled Old and one entitled New. I
want to loop through cells A4:A135 and print those that are bold (
because they dont appear in New) in ListOld and similarly, want to loop
thorugh cells B4:B135 and print those that are bold in ListNew.

After coding this I found that it does not work for fields that are
conditionally bold. So I moved on to compare the lists, and print
those in Old that do not appear in New.

I came up with this:

Private Sub CmdRec_Click()

Dim i As Long

ListOld.Clear

Sheet3.Activate
Sheet3.Range("A4").Select

With Sheet3

For i = 1 To .Range("B" & Rows.Count).End(xlUp).Row
For j = 1 To .Range("A" & Rows.Count).End(xlUp).Row
If Sheet3.Cells(i, "B").Value < Sheet3.Cells(i,
"A").Value Then
ListOld.AddItem (Sheet3.Cells(i, "A").Value)
End If
Next j
Next i

End With

End Sub

Two problems with this:

1. It starts at A1 but I want it to start at A4
2. It prints the 'old' company NUMEROUS times, I guess everytime it
loops through the loop.

Any ideas on how to get what I want?

Thanks!!!
Sheeny


---
Message posted from http://www.ExcelForum.com/

 
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 lists brian New Users to Excel 2 May 11th 09 12:20 PM
Comparing Lists Jazming Excel Worksheet Functions 1 July 3rd 08 07:44 PM
Comparing two lists ExcelHelpNeeded Excel Worksheet Functions 3 September 5th 07 08:18 PM
Comparing two lists pgarcia Excel Discussion (Misc queries) 2 February 20th 07 09:45 PM
comparing lists - i think xeno Excel Discussion (Misc queries) 2 August 18th 06 01:59 PM


All times are GMT +1. The time now is 01:12 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"