Advertisement
YasserKhalil2019

T4068_Loop Using Arrays Template

Oct 9th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. https://excel-egy.com/forum/t4068
  2. ---------------------------------
  3.  
  4. Sub Loop_Using_Arrays_Template()
  5. Dim arr As Variant
  6. Dim t As Single
  7. Dim i As Long
  8.  
  9. arr = Range("A1:E" & Cells(Rows.Count, 1).End(xlUp).Row).Value
  10. t = Timer
  11.  
  12. For i = 1 To UBound(arr, 1)
  13. If arr(i, 3) = "A" Then
  14. arr(i, 5) = 1
  15. End If
  16. Next i
  17.  
  18. Range("A1").Resize(UBound(arr, 1), UBound(arr, 2)).Value = arr
  19. MsgBox Timer - t
  20. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement