Paste Special
16.03.2022 07:45:33
Antonio
Sub Laden()
Dim fd As Office.FileDialog
Dim strDatei As String
Set fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
.Filters.Clear
.Filters.Add "Excel-Dateien", "*.xlsx?", 1
.Title = "Eine Excel-Datei auswählen"
.AllowMultiSelect = False
.InitialFileName = Environ$("USERPROFILE") & "\Desktop\Guitar Chord"
If .Show = True Then
strDatei = .SelectedItems(1)
End If
Workbooks.Open Filename:=strDatei
ActiveWorkbook.Sheets("Progressionen").UsedRange.Copy
ThisWorkbook.Sheets("Progressionen").TextBox1.Text = ActiveWorkbook.Name
ActiveWorkbook.Close
ThisWorkbook.Sheets("Progressionen").Cells(13, 6).PasteSpecial xlPasteValues ', xlPasteFormulas ', xlPasteFormats
ThisWorkbook.Sheets("Progressionen").Cells(13, 6).PasteSpecial xlPasteFormulas
End With
End Sub
Mit diesem Code lade ich eine Datei und versuche die Werte und Formel zu übertragen.Bekomme ein Fehler in:
ThisWorkbook.Sheets("Progressionen").Cells(13, 6).PasteSpecial xlPasteValues ', xlPasteFormulas ', xlPasteFormats
ThisWorkbook.Sheets("Progressionen").Cells(13, 6).PasteSpecial xlPasteFormulas
Kann jemand nachschauen bitte wo der Fehler ist?Danke im Voraus
LG Antonio