Hi All,
I have created the following:
But if the [ code ] value is not found in the range it does not want to do to the next item in the loop.
Kindly assist
EDIT: Moderator added spaces to beginning and end of [ code ] variable, as it was conflicting with code tags used to post the code.
I have created the following:
Code:
Sub CodeChange()
'
' CodeChange Macro
'
For i = [Run_Start] To [Run_End]
[Number] = i
CodetoChange = [ code ]
NewValueReplace = [NewValue]
Dim ws As Worksheet
Dim RA As Range
Set RA = Cells.Find(What:=[ code ], After:=ActiveCell, LookIn:=xlFormulas2, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
RA.Activate
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 15773696
.TintAndShade = 0
.PatternTintAndShade = 0
End With
ActiveCell.Offset(0, 13).Select
ActiveCell.Value = [NewValue]
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 15773696
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Next i
End Sub
But if the [ code ] value is not found in the range it does not want to do to the next item in the loop.
Kindly assist
EDIT: Moderator added spaces to beginning and end of [ code ] variable, as it was conflicting with code tags used to post the code.
Last edited by a moderator: