indi visual
Member
How do I modify this to search For Each C In Range?
This code actually doesn't work, but I was hoping to get help with syntax so that it does.
Basically, if C3:C4 are the same, and A2 contains the word "Required", then I would like to run a code on A3:A4. The problem is I'm not sure how to write this to search for every C in Range.
Sub Find_NotRequired_That_Should_Be_Required()
Dim C As Range
For Each C In Range("A2:C" & Range("A" & Rows.Count).End(xlUp).Row)
If Range("C2").Value = Range("C3:C4") _And
Range("A2").Value = "Required" Then
'''On A3:A4 I would like to search and replace the word "Not Required" with "Required"
Selection.Replace What:="Not Required", Replacement:="Required"
ElseIf Range("A2").Value <> "Required" Then
Next C
End If
End Sub
This code actually doesn't work, but I was hoping to get help with syntax so that it does.
Basically, if C3:C4 are the same, and A2 contains the word "Required", then I would like to run a code on A3:A4. The problem is I'm not sure how to write this to search for every C in Range.
Sub Find_NotRequired_That_Should_Be_Required()
Dim C As Range
For Each C In Range("A2:C" & Range("A" & Rows.Count).End(xlUp).Row)
If Range("C2").Value = Range("C3:C4") _And
Range("A2").Value = "Required" Then
'''On A3:A4 I would like to search and replace the word "Not Required" with "Required"
Selection.Replace What:="Not Required", Replacement:="Required"
ElseIf Range("A2").Value <> "Required" Then
Next C
End If
End Sub