Hi Tom, here is Thiago from the post:
the last post dont allow me to follow up the question.
So i will continue here..
I explained it wrong.
I will try to use an example.
I put in the cell F5 the value "D".
After that the cells G5, H5, I5, J5 and K5 will be filled with "X" and the cell K5 (the last) will be colored with green.
Until now you have already done this, but i need to erase the value that is on cell F5 and when i do this the cells erases and just the G5 keeps with the "X".
So i want that the macro save the result of the cell F5 independent if i erase that.
I'm attaching an image for a better explanation.
Assuming you will manually delete values in column F, then
I believe this will do what you want:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range, r As Range
Dim cellrr As Range, rr As Range
If Not Intersect(Target, Columns(6)) Is Nothing Then
Set rr = Intersect(Target, Columns(6))
Set r = Range("G4:R4")
For Each cellrr In rr ' change in column F
If cellrr.Row > 4 Then ' change is beyond row 4
If Len(Trim(cellrr)) <> 0 Then
If Application.CountIf(r, cellrr.Value) > 0 Then
With cellrr.Offset(0, 1).Resize(1, r.Columns.Count)
.Interior.ColorIndex = xlNone
For Each cell In r
Cells(cellrr.Row, cell.Column).Value = "x"
If UCase(cell.Value) = UCase(cellrr.Value) Then
Cells(cellrr.Row, cell.Column).Interior.ColorIndex = 14