473,406 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

vba code that compares 2 excel sheets.

I need some assistance with a VBA code. I have tried different codes that i found in the forum but they didn't match with what i m looking for. So i will explain what i have , what i need and what i expect.

I have data in 2 worksheets "Sheet1 & Sheet2" . Both sheets have value from columns A to K and almost 10,000 rows.

What I want to do:

Sheet1 is reference sheet and changes have to be made in sheet2 based on values in Sheet1.

For example I have following data in sheet1
Name gender salary
charles Male 2000$
Rachel Female 1000$

Sheet2
Name gender salary
Rachel Female 3000$
charles Male 2000$

The reference should be taken as first cell of the row in sheet1, this is unique data, based on this value it has to check in the sheet2 where the row is and what value does it have.

The unique value is first cell in every row, but in sheet1 and sheet2 the value are jumbled left no easy way for me to compare.

Want I need:

Based on the data on sheet1 if there are any mismatches in sheet2, it should be hightlighted with some color.


Please help me guys I am in deep deep trouble

Thanks
Jul 30 '15 #1
2 2144
jforbes
1,107 Expert 1GB
How often are do you need to do this, just once?
If so, you might want to attempt a Diff on the data.
This might work, depending on your version of Office.
Or you could look at WinMerge which is a great tool to compare two files or lists of text.

If you need to build a tool for this, I would first see if you could use Access to link to the two Excel tables then write a Query to find the discrepancies. Then possibly create a Report based off this Query to be used to update Excel.

Taking this further, you could import all the data into Access and develop whatever you need to replace the Spreadsheet permanently.
Jul 30 '15 #2
NeoPa
32,556 Expert Mod 16PB
Just as a database system would, I suggest starting by sorting the data in both sheets by the unique reference. If it's necessary to maintain the original order then it's easy to create a new column first which you can populate with literal (Create with a formula but change to value before proceeding.) values to reflect the original order (1, 2, 3, ... 2319, 2320 etc).

Once you have two sorted columns then processing the data becomes much easier.
Aug 1 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Ilan | last post by:
Hi all I need to add data from two Excel sheets (both on the same workbook) to an existing table in my SQL DB. The problem is that each sheet holds different fields for the same record, though...
2
by: Osiris Sawiris | last post by:
I inherited an Inventory control application that updates the stock from the branches at the end of each day. We receive the stock transactions via e-mail attachments (Excel Sheets). Those...
1
by: sk | last post by:
Please forgive me if the same topic is already posted. But i havent found I have got an error while accessing the excel file as below. Can somebody reply if there is a solution Access is denied....
0
by: bero81 | last post by:
Hi to everyboby, how can i read the names of excel sheets with vb6?i'm using from my references Microsoft excel 11.0 object library.. could someone help me,please?
1
by: msanger | last post by:
Hi, I have several excel sheets in Office 2007, which has all kinds of standard calculations, and a consolidated Excel Sheet with totals and rollup of all the other excel files. The issue I am...
1
by: Rohan | last post by:
Hello, I would like to write a script which does the following job. Take column1 and 7 from 10 different excel sheets and pasthe them into a new excel worksheet. Any ideas on how to do it Thanks,
1
by: Aswanth | last post by:
I'm Using Asp.Net with C# & SSRS 2005 for Generating Reports.. I'm Having HUGE Data in Microsoft Excel Sheets .. I want to Get this Data from this Microsoft Excel Sheets & to Generate REPORTS in...
1
by: Sekhar C | last post by:
I have 100 excel sheets with same field name,with same number of fields,with similar datatype. i want to transfer data from all excel sheets to one Sql database Table using one Package, i am using...
4
by: einstein | last post by:
Hi, I'm new to perl. I want to compare two excel sheets the second excel file is just the revised version of the first one. There are only two columns each file with a certain number of Rows ...
3
by: rehanemis | last post by:
HI, I am new the ms access programming(VBA). During my work there is need to import 3 columns data into ms access table from various excel sheet and excel sheets format is not always same For...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.