kelly mort
Well-known Member
- Joined
- Apr 10, 2017
- Messages
- 2,169
- Office Version
- 2016
- Platform
- Windows
This code is taking a bit longer time to run. I want to run all processes in memory before placing result to worksheet.
I took the inspiration from @DanteAmor solution at:
1. Code optimization required - run all processes in memory before placing result to worksheet
2. Load part of data to memory, perform some calculations and rank then show alert with message box -vba
Thanks in advance
I took the inspiration from @DanteAmor solution at:
1. Code optimization required - run all processes in memory before placing result to worksheet
2. Load part of data to memory, perform some calculations and rank then show alert with message box -vba
Code:
For i = 1 To 10
For Each cel In .Range("R7:R" & lr).Offset(, i - 1)
Select Case .Cells(cel.Row, "C")
Case "Z " & 1 To "Z " & 3
Select Case cel.Value
Case Is >= 83: cel = 1
Case Is >= 76: cel = 2
Case Is >= 69: cel = 3
Case Is >= 60: cel = 4
Case Is >= 50: cel = 5
Case Is >= 40: cel = 6
Case Is >= 30: cel = 7
Case Is >= 20: cel = 8
Case Is >= 1: cel = 9
End Select
Case Else
Select Case cel.Value
Case Is >= 80: cel = 1
Case Is >= 75: cel = 2
Case Is >= 70: cel = 3
Case Is >= 65: cel = 4
Case Is >= 1: cel = 5
End Select
End Select
Next cel
Next i
Thanks in advance