Guest User

Untitled

a guest
Apr 20th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. Sub match_col_a_b()
  2. Dim x As Integer '重要
  3. ii = 1
  4. For i = 1 To Cells(65536, 1).End(xlUp).Row
  5. On Error Resume Next
  6. x = Application.Match(Cells(i, 1), Range("b:b"), 0)
  7. If Not Err <> 0 Then
  8.  
  9. Else
  10. Cells(ii, 3) = Cells(i, 1)
  11. ii = ii + 1
  12. End If
  13. Next
  14. '---
  15. ii = 1
  16. For i = 1 To Cells(65536, 2).End(xlUp).Row
  17. On Error Resume Next
  18. x = Application.Match(Cells(i, 2), Range("a:a"), 0)
  19. If Not Err <> 0 Then
  20.  
  21. Else
  22. Cells(ii, 4) = Cells(i, 2)
  23. ii = ii + 1
  24. End If
  25. Next
  26. End Sub
Add Comment
Please, Sign In to add comment