PDA

View Full Version : Compare 4 worksheets in a workbook



itipu
07-24-2007, 10:54 PM
Hi All!

I have attached an example so that it will be easier for you guys to understand what I am trying to achieve!

I have a workbook, inside are 4 worksheets (+ 1 called Main Report):

AC, Computer, LRAM, RHN

Each contains a list of machines in Column A

Currently I also have a worksheet called Main Report, it is generated via buttons (you can see code) and it asks user to pick on which worksheets to perform action and starts comparing all entries, the output is presented in the Main Report worksheet.

I want a similar thing, so again ask user to pick out 4 worksheets, but than in the new worksheet (also can be called Main Report) it needs to output:

if in Computer but not in AC then
print machine name & "Not in AC"
move down a row

if in AC but not in Computer then
print machine name & "Not in Computer"
move down a row

if in RHN but not in Computer then
print machine name & "Not in Computer"
move down a row

if in Computer but not in LRAM then
print machine name & "Not in LRAM"
move down a row

Please feel free to modify Main Report code as much as you like!

Thanks a lot for you help! I really appreciate it!

Maybe something like this?
For i = 1 To ?????(SOMETHING)?????
findit = Application.Match(Worksheets(llist).Cells(i, 1).Value, Worksheets(llist1).Range("A1:A" & old_REFDES_length), 0)
If IsError(findit) Then 'no match
Set WS = Worksheets.Add(After:=Sheets(Sheets.Count))
WS.Name = "Main Report"
WS.Range("A1").Value = Worksheets(llist).Cells(i, 1).Value
Else
End If
Next i