View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Teresa Teresa is offline
external usenet poster
 
Posts: 169
Default Changes btw worksheets

I have two spreadsheets: Jobs and Jobs 2

I want to know what differences there are btw the two worksheets,
if there are differences the entire row from "Jobs2" is copied over to a
"Changes" Worksheet, followed by the row from "Jobs"

For Example:
Jobs.xls:

Client Jan Feb Mar
GATT 100 150 200

Jobs2.xls:

Client Jan Feb Mar
GATT 150 250 300


I need to get to:
Changes.xls

Client Jan Feb Mar
GATT 150 250 300
100 150 200
---------------------------------
50 100 100

This is the code I have so far, I feel I'm missing a few lines:

k = 2
For i = 1 To 300
For j = 1 To 70
If Worksheets("Jobs").Cells(i, j) < Worksheets("Jobs2").Cells(i, j) Then
Worksheets("Jobs").Cells(i, j).EntireRow.Copy
Destination:=Worksheets("Changes").Cells(k, 1)
k = k + 1
Exit For
End If
Next j
Next i