AW: Gruppierte Tabellenblätter kopieren per Makro ?
ralle
... druch folgendes Makro:
Option Explicit
Private Sub cmbFile_Click()
FillList
End Sub
Private Sub cmdCancel_Click()
'Userform schliessen
Unload Me
End Sub
Private Sub cmdDelete_Click()
Dim intC As Integer
On Error GoTo FEHLER
Workbooks(cmbFile.Text).Activate
If lstSheet.ListCount > 1 Then
With Application
.ScreenUpdating = False
.DisplayAlerts = False
End With
With lstSheet
For intC = 0 To .ListCount - 1
If .Selected(intC) Then Workbooks(cmbFile.Text).Sheets(.List(intC)).Select False
Next
End With
Else
MsgBox "Die ausgewählte Datei enthält nur ein Tabellenblatt!", vbExclamation
End If
FEHLER:
FillList
With Application
.ScreenUpdating = True
.DisplayAlerts = True
End With
End Sub
Private Sub UserForm_Initialize()
Dim wkb As Workbook
'ComboBox füllen
For Each wkb In Application.Workbooks
cmbFile.AddItem wkb.Name
Next
'cmbFile.ListIndex = 0
cmbFile = ActiveWorkbook.Name
FillList
End Sub
Private Sub FillList()
Dim wks As Worksheet
'ListBox füllen
lstSheet.Clear
For Each wks In Workbooks(cmbFile.Text).Sheets
lstSheet.AddItem wks.Name
Next
End Sub
Aber zur vereinfachung kann ich die Tabellenblätter natürlich auch manuell auswählen, durch gedrückter STRG-Taste und linker Maustaste.
Gruß
ralle