how the code for sorting the layer ==================== Private Sub UserForm_Initialize() Dim LayerName As String Dim Alayer As AcadLayer For Each Alayer In ThisDrawing.Layers LayerName = Alayer.Name ListBox1.AddItem (LayerName) Next End Sub