• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

2 Sheets that have different no of rows need to compare and then copy the changes in 3rd sheet

Sunnyji

New Member
Hi,
I am new to VBA. I have just started learning the VBA. I have to create a Macro or small VBA code for a task.
I have to compare every month, the new month's sheet with the previous month's sheet to find out the changes that occur in the new month's sheet. My sheet contains rows between 1150 ~ and 1200 and it has columns
A to W(A: W). Both sheets have different numbers of rows as some rows are deleted and some new rows are added in the new month's file. Colum A always contains a unique value (ID# like 1, 2, 3,4,. . . .) that I use to compare
what ID has been deleted and what new ID has been added. Also, every month some small changes occur in some records between Columns A: W in the new sheets. (I have attached a sample with a small # of rows and just a few columns but the actual columns are A: W and rows almost 1200).
I want a short VBA code that should compare both the old Month's sheet and the new month's sheet to achieve the following result:
1) Highlight the whole row with blue color in the old Month's sheet (sheet1) where the old ID has been deleted.
2) Highlight the cells in the new month's(sheet2) with a yellow color that have been modified
3) Highlight the rows in the new month's sheet(sheet2)with green color where a new ID has been added and then copy from sheet 2 to sheet3 only those rows that have yellow highlighted cells and highlighted in green color

I heard many experts VBA programmers are on this site and they have been doing an amazing job helping people who want to learn VBA coding.

Old Month's file

ID Analyst Name Description Site Location Time assigned to work(hrs.) Time Spent (hrs.) Status
1 Mike Mike works to analyze scientific data Calgary Downtown 24:00:00 28:00:00 Completed
2 Kevin Kevin analyze algorithm Montreal Uptown 6:00:00 8:00:00 in progress
3 Kumar Kumar checks logic and formula Delhi Capital 18:00:00 10:00:00 InProgress
4 Jamal Jamal makes sure quality assurance Lahore south 72:00:00 72:00:00 Completed
5 Kishore Kishore works on facility and infrastructure Bombay Central 6:00:00 0:00:00 Not started
6 Marvin Take care of the security of the building London Downtown 36:00:00 54:00:00 Pending
7 John Supports Applications Barrie North 18:00:00 36:00:00 Completed
8 Bobby Leads and supervises for Incident Management Bombay South 10:00:00 16:00:00 InProgress
9 Daniel Manages Covid Protocols and health Florida West 6:00:00 0:00:00 Not started
10 Spencer Internet Service Specialist Sydney Downtown 12:00:00 16:00:00 Pending


New Month's file

ID Analyst Name Description Site Location Time assigned to work(hrs.) Time Spent (hrs.) Status
1 Mike Mike works to analyze scientific data Calgary Downtown 22:00:00 28:00:00 Completed
2 Kevin Kevin analyze algorithm Montreal Uptown 6:00:00 8:00:00 Completed
3 Kumar Kumar checks logic and formula Delhi East 18:00:00 10:00:00 InProgress
6 Marvin Take care of the security of the building London Downtown 36:00:00 54:00:00 InProgress
7 John Supports Applications and Databases Barrie North 18:00:00 36:00:00 Completed
8 Bobby Leads and supervises Incident Management Bombay South 10:00:00 20:00:00 InProgress
9 Daniel Manages Corvid Protocols and health Chicago North 6:00:00 2:00:00 InProgress
11 Kerby Modify the data. Data Specialist Toronto East 18:00:00 0:00:00 Not started
12 Ruby Contact businesses. Business Coordinator. Toronto South 24:00:00 12:00:00 Pending
13 Sumel Take care of electricity and energy facility Washington South 4:00:00 0:00:00 Not started




Best Regards,
Sunny
 

Attachments

Hi, as this is a wild cross-posting :eek: so according to any Excel forum rules​
you must first post a link for each other forum where you have created the same thread !​
And obviously proceeding the same on each other forum …​
 
Back
Top