[vba]
Private Sub CommandButton1_Click()
Dim SheetNames As String
Dim sh As Worksheet
ThisWorkbook.Worksheets(Array("Sheet1", "Sheet2", "Sheet3")).Copy
If Me.TextBox1.Value = "" Then
MsgBox "No filename"
Exit Sub
End If
If Not Me.CheckBox1.Value And Not Me.CheckBox2.Value And Not Me.CheckBox3.Value Then
MsgBox "No sheets selected"
Exit Sub
End If
Application.DisplayAlerts = False
With ActiveWorkbook
.Worksheets("Sheet1").OLEObjects("CommandButton1").Delete
If Not Me.CheckBox1 Then .Worksheets("Sheet1").Delete
If Not Me.CheckBox2 Then .Worksheets("Sheet2").Delete
If Not Me.CheckBox3 Then .Worksheets("Sheet3").Delete
End With
Application.DisplayAlerts = True
ActiveWorkbook.SaveAs TextBox1.Text
End Sub
[/vba]