Hello hussain66,
Welcome to ExcelFox
Your question is a bit short and undetailed. So we don’t know exactly what help you need.
Here is a very simple VBA macro that might work for you.
It goes through the cell items in the used range of the first worksheet. It goes through in the typical conventional way of all columns in a row , then down to the next row , and so on, until all cells used in the used range in the first worksheet are considered. Say for example you had used 2 columns and 3 rows, then it loops through the cells like this
1 2
3 4
5 6
That number sequence is also is the Item( ) number of the cells
At each of the 6 loopings, it checks to see if there is a difference in the corresponding Cells in the used ranges in the first two worksheets. If there is a difference then the cell will be highlighted in yellow.
In this simple example, in order for it to work, the used ranges would need to be the same in both worksheets.
Code:
Sub QuickCommparison() ' https://www.excelfox.com/forum/showt...ll=1#post23871
Dim ArCel As Range
Dim Cnt As Long
For Cnt = 1 To ThisWorkbook.Worksheets.Item(1).UsedRange.Cells.Count
If ThisWorkbook.Worksheets.Item(1).UsedRange.Item(Cnt).Value <> ThisWorkbook.Worksheets.Item(2).UsedRange.Item(Cnt).Value Then Let ThisWorkbook.Worksheets.Item(1).UsedRange.Item(Cnt).Interior.Color = 65535
Next Cnt
End Sub
By the way, there may very likely be some built in ways or other Add-Ins or many other ways to check differences in worksheets without the use of VBA. ( I am not personally familiar with much outside VBA )
Alan
https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
https://www.youtube.com/watch?v=jdPeMPT98QU
https://www.youtube.com/watch?v=QdwDnUz96W0&lc=Ugx3syV3Bw6bxddVyBx4AaABAg
https://www.youtube.com/watch?v=U76ZRIzBhOA&lc=UgxsozCmRd3RAmIPO5B4AaABAg. 9fxrOrrvTln9g9wr8mv2CS
https://www.youtube.com/watch?v=U76ZRIzBhOA&lc=Ugw6zxOMtNCfmdllKQl4AaABAg
https://www.youtube.com/watch?v=U76ZRIzBhOA&lc=UgyT1lo2YMUyZ50bLeR4AaABAg. 9fz3_oaiUeK9g96yGbAX4t
https://www.youtube.com/watch?v=U76ZRIzBhOA&lc=Ugx5d-LrmoMM_hsJK2N4AaABAg.9fyL20jCtOI9g7pczEpcTz
https://www.youtube.com/watch?v=U76ZRIzBhOA&lc=UgyT1lo2YMUyZ50bLeR4AaABAg. 9fz3_oaiUeK9g7lhoX-ar5
https://www.youtube.com/watch?v=U76ZRIzBhOA&lc=Ugx5d-LrmoMM_hsJK2N4AaABAg.9fyL20jCtOI9gD0AA-sfpl
https://www.youtube.com/watch?v=U76ZRIzBhOA&lc=Ugx5d-LrmoMM_hsJK2N4AaABAg.9fyL20jCtOI9gECpsAVGbh
https://www.youtube.com/watch?v=U76ZRIzBhOA&lc=Ugw6zxOMtNCfmdllKQl4AaABAg. 9g9wJCunNRa9gJGhDZ4RI2
https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
Bookmarks