Advertisement
YasserKhalil2019

T3940_Copy From Another Column By Application Match

Sep 19th, 2019
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. https://excel-egy.com/forum/t3940
  2. ---------------------------------
  3.  
  4. Sub Copy_From_Another_Column_By_Application_Match()
  5. Dim x, c As Range
  6.  
  7. Application.ScreenUpdating = False
  8. With ThisWorkbook.Worksheets(1)
  9. For Each c In .Range("D4:D" & .Cells(Rows.Count, "D").End(xlUp).Row)
  10. x = Application.Match(c.Value, .Columns(30), 0)
  11.  
  12. If Not IsError(x) Then
  13. .Range("F" & c.Row).Resize(1, 2).Value = .Range("AF" & x).Resize(1, 2).Value
  14. .Range("F" & c.Row).Resize(1, 2).Interior.Color = vbCyan
  15. End If
  16. Next c
  17. End With
  18. Application.ScreenUpdating = True
  19. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement