Option
Explicit
Private
Sub
CommandButton1_Click()
Dim
SourceFile
As
Workbook
Dim
TargetFile
As
Workbook
Dim
OpenString
As
String
Application.ScreenUpdating =
False
Application.DisplayAlerts =
False
Application.EnableEvents =
False
Set
TargetFile = ThisWorkbook
OpenString = Application.GetOpenFilename(Title:=
"Please choose a file to open"
, FileFilter:=
"Excel Files *.xlsm*,"
)
Set
SourceFile = Workbooks.Open(OpenString,
False
,
True
)
TargetFile.Worksheets(1).Cells(1, 1).Value = <strong>SourceFile</strong>.Worksheets(
"Tabelle1"
).Cells(1, 1).Value
SourceFile.Close
Set
TargetFile =
Nothing
Set
SourceFile =
Nothing
Application.ScreenUpdating =
True
Application.DisplayAlerts =
True
Application.EnableEvents =
True
End
Sub