There is a table:

You need to set up automatic sorting by column B, namely how you understand "B2". And here is one of the options, as I try to implement it using VBA methods:
Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("B3:B4")) Is Nothing Then Exit Sub [B2].CurrentRegion.Sort [B2], xlAscending, Key2:=[C2], Order2:=xlAscending, Header:=xlYes End Sub And look what he does to me when you type in cell B4 -> 2:

I tried various options, but it does not work out for me at all. What to do?