Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have an excel sheet that is updated every day. I would like compare the two
sheets and give me cells that have changed with exact values: Eg: Clothes in stock - 56 Clothes displayed - 30 Clothes sold - 34 Next day Clothes in stock - 50 Clothes displayed - 31 Clothes sold - 39 Its much more complicated that this but that is the basic jist. thanks, Raoul |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Here's a quick and dirty routine you can adapt for your purposes. It will
compare "Book1.xls" and "Book2.xls" and list the differences in a new workbook. Sub SimpleCompare() Dim WB1 As Workbook Dim WB2 As Workbook Dim ResultWB As Workbook Dim WS1 As Worksheet Dim WS2 As Worksheet Dim Rng1 As Range Dim Rng2 Dim DestRng As Range Set WB1 = Workbooks("Book1.xls") '<<< CHANGE Set WB2 = Workbooks("Book2.xls") '<<< CHANGE Set ResultWB = Workbooks.Add() Set DestRng = ResultWB.Worksheets(1).Range("A1") DestRng(1, 1) = "Cell" DestRng(1, 2) = WB1.Name & "Value" DestRng(1, 3) = WB2.Name & "Value" Set DestRng = DestRng(2, 1) For Each WS1 In WB1.Worksheets Set WS2 = WB2.Worksheets(WS1.Name) For Each Rng1 In WS1.UsedRange.Cells Set Rng2 = WS2.Range(Rng1.Address) If Rng1 < Rng2 Then DestRng(1, 1) = Rng1.Address DestRng(1, 2) = Rng1.Text DestRng(1, 3) = Rng2.Text Set DestRng = DestRng(2, 1) End If Next Rng1 Next WS1 End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) "Raoul" wrote in message ... I have an excel sheet that is updated every day. I would like compare the two sheets and give me cells that have changed with exact values: Eg: Clothes in stock - 56 Clothes displayed - 30 Clothes sold - 34 Next day Clothes in stock - 50 Clothes displayed - 31 Clothes sold - 39 Its much more complicated that this but that is the basic jist. thanks, Raoul |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Check out Jim Cone's fine commercial Add-in called XL Companion. It's
available at http://www.realezsites.com/bus/primitivesoftware/ Vaya con Dios, Chuck, CABGx3 "Raoul" wrote: I have an excel sheet that is updated every day. I would like compare the two sheets and give me cells that have changed with exact values: Eg: Clothes in stock - 56 Clothes displayed - 30 Clothes sold - 34 Next day Clothes in stock - 50 Clothes displayed - 31 Clothes sold - 39 Its much more complicated that this but that is the basic jist. thanks, Raoul |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I assume these are in the same cell, different sheet name.. so you can try
maybe: In cell B2 of sheet 3: =if(sheet1!B2=sheet2!B2,"",sheet2!B2) Although this would leave blanks where the cells don't match... "Raoul" wrote: I have an excel sheet that is updated every day. I would like compare the two sheets and give me cells that have changed with exact values: Eg: Clothes in stock - 56 Clothes displayed - 30 Clothes sold - 34 Next day Clothes in stock - 50 Clothes displayed - 31 Clothes sold - 39 Its much more complicated that this but that is the basic jist. thanks, Raoul |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to hide a macros/functions from excel sheets | Excel Discussion (Misc queries) | |||
Excel 2007 to Excel 2003 (Split data to sheets) | Excel Discussion (Misc queries) | |||
Excel Range Value issue (Excel 97 Vs Excel 2003) | Excel Discussion (Misc queries) | |||
excel should have a function to count sheets | Excel Worksheet Functions | |||
calculating excel spreadsheet files for pensions and life insurance (including age calculation sheets) | Excel Worksheet Functions |