Change Activecell to your variable Cell to enter the values
If you don't restrict "r", the code has to check all 2^20 cells in the column. There are various ways to do this e.g. finding LastRow
Using UCase avoids error due to capitalisation of data.
Sub task3V3P3()
Dim rng As Range
Dim cell As Range
With ActiveSheet
Set rng = Intersect(.UsedRange, .Range("Q:Q"))
End With
If Not rng Is Nothing Then
For Each cell In rng.Cells
If UCase(cell.Offset(0, -3).Value) = "APPROVED" Or UCase(cell.Offset(0, -3).Value) = "QUOT" Then
cell.Value = cell.Offset(0, 20).Value
End If
Next
End If
End Sub
Alternative code
Sub task3V3P4()
Dim rng As Range
Dim cell As Range
Set rng = Range("N:N").SpecialCells(xlCellTypeConstants)
If Not rng Is Nothing Then
For Each cell In rng.Cells
If UCase(cell.Value) = "APPROVED" Or UCase(cell.Value) = "QUOT" Then
cell.Offset(, 3) = cell.Offset(0, 23).Value
End If
Next
End If
End Sub