Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default 2 Worksheet Comparison Across 2 Workbooks

I have two worksheets in two different workbooks - the worksheets are
named "EARNED" and "Pay App Qty's". Each of these worksheets are
fairly complex and pull values automatically from OTHER worksheets
contained within their respective workbooks.

Column A in both worksheets contains specific Item Numbers - what I
need is code that will compare column A of both worksheets and when a
match is found copy a quantity from the appropriate cell in Column Z of
"Pay App Qty's" and paste it into the appropriate cell
in Column C of "EARNED".

"Pay App Qty's" contains multiple hidden rows - ONLY the visible rows
need to be included in the comparison.

Column Z of "Pay App Qty's" pulls figures from other worksheets within
it's workbook.

Item Number data starts in cell A7 of "Pay App Qty's".
Quantity data starts in Cell Z7 of "Pay App Qty's".

Item Number data starts in cell A2 of "EARNED".
Quantity data starts in cell C2 of "EARNED".

Data in "Pay App Qty's" currently goes to row 446.
Data in "EARNED" currently goes to row 271.

I am using Excel 2002 SP-2 and running Windows XP Professional.

Any and all help is sincerely appreciated.


Thanks!

- Kobi

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default 2 Worksheet Comparison Across 2 Workbooks

Copying these 2 worksheets into a new workbook and naming them "sheet1"
and "sheet2" is an option.

Anyone have any idea on this?


Thanks!

- Kobi

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default 2 Worksheet Comparison Across 2 Workbooks

Bump

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 2 Worksheet Comparison Across 2 Workbooks

Sub Compare()
Dim TB1 As Worksheet, TB2 As Worksheet
Dim R1%, R2%, i%, y%
Set TB1 = Workbooks("testbook1.xls").Worksheets(1) 'You added the file
name
Set TB2 = Workbooks("testbook2.xls").Worksheets(1) 'You added the file
name
R1 = TB1.Cells(Rows.Count, 1).End(xlUp).Row
R2 = TB2.Cells(Rows.Count, 1).End(xlUp).Row

For i = 1 To R1
For y = 1 To R2
If TB1.Cells(i, 1) = TB2.Cells(y, 1) Then
TB2.Cells(y, 1) = "Match" 'puts match
in A column

Exit For
End If
Next y
Next i

End Sub



Now you will need something to put the contents in the cell after you compare.
YOu need to move to that column.
ActiveCell.Offset(0, 25).Range("A1").Select '25 moves from A over to Z
PayAppQty= ActiveCell.FormulaR1C1 'content of Z cell placed in
payappqty

then move back...
ActiveCell = PayAppQty

Place this last bit of code in your sub as needed to fit your files.

" wrote:

Bump


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
Lookup or worksheet comparison ComicFly Excel Worksheet Functions 0 February 6th 08 02:23 PM
bringing data together from two worksheet for comparison jb Excel Worksheet Functions 1 September 21st 07 02:28 PM
Data Comparison in Workbooks RWilliams Excel Worksheet Functions 2 May 16th 07 09:41 AM
Excel worksheet comparison software Colin Hayes Excel Worksheet Functions 3 November 29th 06 02:58 AM
Different workbooks to one worksheet Jan Excel Discussion (Misc queries) 2 July 27th 06 04:34 PM


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