The first thing you could try is not activating/selecting.
Sub CW7D()
Dim rng As Range
Application.ScreenUpdating = False
' set reference to start of range (column B has ***)
Set rng = RAW.Range("A2")
' referenceed cellWhile the activecell isn't blank...
Do
'The logical test...
'If the value of the referenced cell is "CW7", AND the adjacent cell begins with "D"...
If rng.Value = "CW7" And rng.Offset(0, 1).Value Like "D*" Then
' set referenced cell to "CW7D"
rng.Value = "CW7D"
'Move down a cell
Set rng = rng.Offset(1, 0)
End If
' loop untile referenced cell is blank
Loop Until rng.Value = ""
Application.ScreenUpdating = True
End Sub
If that doesn't speed things up sufficiently you could try using an array.
Option Explicit
Sub CW7D()
Dim rng As Range
Dim I As Long
Dim arrData As Variant
Application.ScreenUpdating = False
' set reference to start of range (column B has ***)
Set rng = RAW.Range("A2").CurrentRegion
arrData = RAW.Range("A2").CurrentRegion
For I = LBound(arrData, 1) To UBound(arrData, 1)
If arrData(I, 1) = "CW7" And arrData(I, 2) Like "D*" Then
arrData(I, 1) = "CW7D"
End If
Next I
rng.Value = arrData
Application.ScreenUpdating = True
End Sub
Bookmarks