Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello, i want to make a function for comparing two excel file.
If A2(xls1) is found in ColumnB(xls2) then check if B2(xls1) is equal to ColumnB(xls2) cell Result If equal then input "ok" in E2(xls1) if not equal the input "wrong" in E2(xls1) Else "Not Found" |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Macro1()
Dim c As Range Dim rng As Range Dim bFound As Boolean Dim iEnd As Long Dim ws1 As Worksheet Dim ws2 As Worksheet Set ws1 = Sheets("Sheet1") Set ws2 = Workbooks("Book2").Sheets("Sheet1") iEnd = ws2.Range("B65536").End(xlUp).Row Set rng = ws2.Range("B1:B" & iEnd) For Each c In rng If ws1.Range("A2") = c Then If ws1.Range("B2") = c Then ws1.Range("E2") = "ok" Else ws1.Range("E2") = "wrong" End If bFound = True Exit For End If Next c If bFound = False Then ws1.Range("E2") = "Not Found" End If End Sub Hth, Merjet |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello, Thanks for giving me idea, but sorry I think i have not made my
explanation more clear. If A2(Worksheet1) is found in ColumnA(Worksheet2) then check if B2(Worksheet1) is equal to ColumnB(Worksheet2) cell Result "example of above: if it is found in B4(worksheet2), then compare it with B2(worksheet1)" If equal then input "ok" in E2(worksheet1) if not equal the input "wrong" in E2(worksheet1) Else "Not Found" |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi, also I include screenshot of what I want to accomplish.
Thank you for your help http://glv.ne.jp/xls.JPG |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Comparison | Excel Discussion (Misc queries) | |||
Complex comparison of Columns of Data: Extracting unique records after comparison on 4 levels | Excel Programming | |||
IF Statements (Mutliple Statements) | Excel Worksheet Functions | |||
operator statements, shorting when reusing one of the statements? | Excel Programming | |||
Comparison | Excel Worksheet Functions |