复制代码Sub sheets2one()'定义对话框变量Dim cc As FileDialogSet cc = Application.FileDialog(msoFileDialogFilePicker)Dim newwork As WorkbookSet newwork = Workbooks.AddWith ccIf .Show = -1 ThenDim vrtSelectedItem As VariantDim i As Integeri = 1For Each vrtSelectedItem In .SelectedItemsDim tempwb As WorkbookSet tempwb = Workbooks.Open(vrtSelectedItem)tempwb.Worksheets(1).Copy Before:=newwork.Worksheets(i)newwork.Worksheets(i).Name = VBA.Replace(tempwb.Name, ".xls", "")tempwb.Close SaveChanges:=Falsei = i + 1Next vrtSelectedItemEnd IfEnd WithSet cc = NothingEnd Sub