Hi all

I have a list I need to create daily.
I am sorting each the data by column B
Then, after each change in B I insert two lines
After that each block is colored with a pre-defined color. (Range A to P)
The place for the values can vary - so the value "ABC" could be in cell B10 today, but in B279 tomorrow.


I'd like to automise the coloring process (and possibly the inserting rows part as well)
So far I have found this code - but the value must be in a specific row - i'd like this part to be flexible.

Private Sub Workbook_SheetChange(ByVal sh As Object, ByVal Target As Range)




    If Range("O2") = "1" Then

        Range("A2:T2").Interior.ColorIndex = 1 'red
    
        Else
             End If
    
     If Range("O2") = "2" Then

        Range("A2:T2").Interior.ColorIndex = 2 'red
    
        Else
            
         
        
  
        
        End If
    
    
    
End Sub


Note: Empty cells in column B should result in a "No Fill" for the entire line.