Forum Discussion

dawesy's avatar
dawesy
Brass Contributor
Jul 28, 2022

sorting names etc

 I have this sheet in excel i was wondering if it possible to automatically insert a new name in the 

names column and keep the data in line with the persons names already listed i now i can do it manually 

but would like if possible just insert a name and press enter and sort it automatically any suggestions 

would be appreciated 

Ian

2 Replies

  • dawesy 

    Sub NamesSort()
    
       Application.ScreenUpdating = False
    
       Range("A5:S36").Sort key1:=Range("A5"), _
          order1:=xlAscending, Header:=xlYes
    
       Application.ScreenUpdating = True
       
    End Sub

    Maybe with this code. In the attached file you can insert a new name in range A5:A36 and then click the button in cell V6 to run the macro.

    • dawesy's avatar
      dawesy
      Brass Contributor

      OliverScheurich 

      Hi there sorry if it has taken me so long to respond to your reply seems things got to hectic around here but getting back to the problem i had i have got to say thank you very much for solving the problem for me the Macro appears to be doing everything i wanted it to do.

      Again thank you for your help.

      Ian Dawes