That code works perfectly! Thank you Stanly! There is a little more I have to do and have tried and cannot figure it out. I also have to look for the letter "C" within the same column and mark the rows red and change the column "L" value to a negative number, which I did figure out by duplicating a bit of the code.
The part I am struggling with however is adding to this code that if column "AD" contains an "O" then I need to delete the entire row. The code I wrote does not catch all of the "O"'s and I have to run it twice.
I will include a sample as to show what I'm dealing with. Here is the code I am using:
Sub findSandOinAD()
Dim s As Range 'this WORKS
Dim c As Range 'this WORKS
Dim o As Range 'this does NOT work yet
For Each s In Range("AD2", Range("AD" & Rows.Count).End(xlUp))
If UCase(s.Value) = "S" Then
Range(Cells(s.Row, 1), Cells(s.Row, 39)).Font.ColorIndex = 3
Range("L" & s.Row) = Range("L" & s.Row) * -1
End If
Next s
For Each c In Range("AD2", Range("AD" & Rows.Count).End(xlUp))
If UCase(c.Value) = "C" Then
Range(Cells(c.Row, 1), Cells(c.Row, 39)).Font.ColorIndex = 3
Range("L" & c.Row) = Range("L" & c.Row) * -1
End If
Next c
'the code below is to delete rows with an "O" in column AD but does not catch all of them.
For Each o In Range("AD2", Range("AD" & Rows.Count).End(xlUp))
If UCase(o.Value) = "O" Then
o.Cells.Select
Selection.EntireRow.Delete
End If
Next o
End Sub
Thanks for any help!
Kelly
Bookmarks