Dear all,
In my excel file I have a dataset for which I need to re-label some items. Below I have a part of the code that looks at a certain value and then decides the final label. The whole dataset is approx 30000 lines long but it takes forever to complete this (simple?) task?
I would be keen to understand why this is so slow as I need this type of loop coding for other queries as well.
Thanks!
Bundi
Sub Update_data()
' 0. Variables
' ============
' Variables for loops
Dim i As Long
Dim viapoint As String
' 1. Computation
' ==============
' Desactivate display of Sheets during computation
Application.ScreenUpdating = False
'First dataline
i = 2
'Start Loop
Do While Not IsEmpty(Cells(i, 1))
'In loop variables
viapoint = Cells(i, 4)
' Step 1 Flow
Select Case viapoint
Case "Direct traffic"
Cells(i, 10) = "Direct"
Case Else
Cells(i, 10) = "Indirect"
End Select
i = i + 1
Loop
Application.ScreenUpdating = True
End Sub
Bookmarks