Computing Staff
  • 0

I Wnat To Automatically Sort A When New Data Is Entered

  • 0

is there a simple way to automatically sort without using macros

Share

1 Answer

  1. Try this version:

    Private Sub Worksheet_Change(ByVal Target As Range)
      If Target.Column = 3 Then
         Columns("A:B").Sort Key1:=Range("B1"), Order1:=xlAscending, Key2:=Range("A1") _
            , Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
            False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _
            :=xlSortNormal
       End If
    End Sub

    Click Here Before Posting Data or VBA Code —> How To Post Data or Code.

    • 0