2012/2/11 Bé Trần Văn <betnmtdongna...@gmail.com>

>
>
> 2012/2/11 Yahya Muhammad <yahya...@gmail.com>
>
>>
>>
>> Please find it attached.
>>
>>
>>
>>
>> On Sat, Feb 11, 2012 at 7:34 AM, <chhajersand...@gmail.com> wrote:
>>
>>> Dear Excel Expert,
>>>
>>> I am a ardent follower of this group and I have seen that some one has
>>> posted in this forum a Add in to compare two worksheet.
>>>
>>> May I request the expert to repost the add in again.
>>>
>>> Thanking You,
>>> Sandeep Chhajer.
>>> Sent on my BlackBerry® from Vodafone
>>>
>>> --
>>> FORUM RULES (986+ members already BANNED for violation)
>>>
>>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>>> will not get quick attention or may not be answered.
>>>
>>> 2) Don't post a question in the thread of another member.
>>>
>>> 3) Don't post questions regarding breaking or bypassing any security
>>> measure.
>>>
>>> 4) Acknowledge the responses you receive, good or bad.
>>>
>>> 5)  Cross-promotion of, or links to, forums competitive to this forum in
>>> signatures are prohibited.
>>>
>>> NOTE  : Don't ever post personal or confidential data in a workbook.
>>> Forum owners and members are not responsible for any loss.
>>>
>>>
>>> ------------------------------------------------------------------------------------------------------
>>> To post to this group, send email to excel-macros@googlegroups.com
>>>
>>
>>  --
>> FORUM RULES (986+ members already BANNED for violation)
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>> will not get quick attention or may not be answered.
>>
>> 2) Don't post a question in the thread of another member.
>>
>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>>
>> 4) Acknowledge the responses you receive, good or bad.
>>
>> 5) Cross-promotion of, or links to, forums competitive to this forum in
>> signatures are prohibited.
>>
>> NOTE : Don't ever post personal or confidential data in a workbook. Forum
>> owners and members are not responsible for any loss.
>>
>>
>> ------------------------------------------------------------------------------------------------------
>> To post to this group, send email to excel-macros@googlegroups.com
>>
>
> Compare column b with a similar if not then yes it is in column C. Using
> the function
> =IF(COUNTIF(A:A,B1)>0,"Yes","No")
>
> Use comparison function with Sheet2 Sheet3
> =IF(COUNTIF(Sheet2!A1:A9,Sheet3!A4)>0,"YES","NO")
> See Attachment
>
>
Use code:
Open File KIEMTRA compare button to compare DS Sheet of NGUON files, the DICH
sheet of the DICH file. Just open the File KIEMTRA and click Compare,
compare the data in the blue area.

Code:
Option Explicit
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Dim data As Range, data1 As Range
Dim Sh1
Dim wb As Workbooks
Dim n As Integer, r As Integer
Workbooks.Open ThisWorkbook.Path & "\NGUON.xls"
Workbooks.Open ThisWorkbook.Path & "\DICH.xls"
Set data = Workbooks("NGUON.xls").Sheets("DS").Range("a:c")
Set Sh1 = Workbooks("DICH.xls").Sheets("DICH")
[A2:D10000].Clear
Set data1 = Sh1.Range(Sh1.[A2], Sh1.[b6500].End(3))
data1.Copy
[A2].PasteSpecial 3
n = [A65000].End(3).Row
For r = 2 To n
    Cells(r, 3) = Application.VLookup(Cells(r, 1).Value, data, 2, 0)
    Cells(r, 3) = Application.Trim(Cells(r, 3))
    Cells(r, 3).Replace "#N/A", ""
    Cells(r, 2) = Application.Trim(Cells(r, 2))
    Cells(r, 2) = UCase(Cells(r, 2))
    If Cells(r, 2) = Cells(r, 3) Then
        Cells(r, 4) = Empty
    ElseIf Cells(r, 3) <> "" And Cells(r, 3) <> Cells(r, 2) Then
        Cells(r, 4) = "wrong name"
    Else
        Cells(r, 4) = "No name"
    End If
Next
Workbooks("NGUON.xls").Close False
Workbooks("DICH.xls").Close False
With [A1].CurrentRegion
.AutoFilter Field:=4, Criteria1:=""
Rows("2:10000").Delete
.AutoFilter
.HorizontalAlignment = xlCenter
End With
[A1].Select
End Sub

-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

Attachment: Comparison between two sheets.rar
Description: application/rar

Reply via email to