Option Explicit

Dim f As Worksheet, i&

Private Sub ComboBox1_Change()

End Sub

Private Sub CommandButton1_Click()
    Unload Me
End Sub

Private Sub CommandButton2_Click()
    If TextBox1 = "" Then
        MsgBox "Give a name to Junction Box", 16
        Exit Sub
    End If
    
    For i = 0 To ComboBox1.ListCount - 1
        Label2.ForeColor = &H80000008
        If UCase(TextBox1) = UCase(ComboBox1.List(i)) Then
            Label2.ForeColor = &HFF&
            MsgBox "Name already exists." & Chr(13) & _
                    "Choose another one", 16
            Exit Sub
        End If
    Next i
    
    Sheets(ComboBox1.Value).Copy before:=Sheets(3)
    ActiveSheet.Name = TextBox1
    Sheets("List").Activate
    Unload Me
End Sub

Sub Recopie()
    Sheets("List").Range("D2").Copy
    Sheets("TextBox1").Range("H12").PasteSpecial xlpastevalue
    ActiveSheet.Name = TextBox1
End Sub

Private Sub Label1_Click()

End Sub

Private Sub TextBox1_Change()

End Sub

Private Sub UserForm_initialize()
    
    For Each f In Worksheets
        If f.Name <> "List" Then
            ComboBox1.AddItem f.Name
        End If
    Next f
End Sub
