Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Changes btw worksheets

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("Jobs2").Cells(i, j).EntireRow.Copy _
Destination:=Worksheets("Changes").Cells(k, 1)
Worksheets("Jobs").Cells(i,j).EntireRow.Copy _
Destination:=Worksheets("Changes").Cells(k+1,1)
with Worksheets("Changes")
.Cells(k+1,1).clearContents
for m = 2 to 70
.cells(k+2,m).Value = .cells(k,m) - .cells(k+1,m)
Next m
End with
k = k + 3
Exit For
End If
Next j
Next i


--
Regards,
Tom Ogilvy

"teresa" wrote in message
...
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




Reply
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
How use info in Excel shared worksheets to create new worksheets dkc Excel Worksheet Functions 0 June 28th 07 08:36 PM
How do i assign the ActiveWorkbook.Worksheets to a worksheets object? TS Excel Worksheet Functions 2 December 27th 06 02:49 PM
Assigning Cells in worksheets to other data in other worksheets. David McRitchie Excel Discussion (Misc queries) 0 November 27th 04 06:15 PM
Sort Numerically Worksheets via VB when creating a new worksheets John Excel Programming 6 June 1st 04 07:21 AM
Need code to protect worksheets - amount of worksheets varies Sandy[_3_] Excel Programming 1 September 9th 03 02:17 AM


All times are GMT +1. The time now is 12:01 AM.

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"