Public
Sub
Grobplanung_saeubern()
Dim
ws
As
Worksheet
Dim
wb
As
Workbook
Dim
savePath
As
String
Dim
saveFileName
As
String
Dim
saveFileDialog
As
fileDialog
Set
saveFileDialog = Application.fileDialog(msoFileDialogSaveAs)
Set
wb = ActiveWorkbook
Set
ws = wb.Sheets(
"Teilnehmerliste"
)
With
saveFileDialog
.InitialFileName = savePath & saveFileName &
".xlsx"
.Title =
"Save As"
.ButtonName =
"Save"
.AllowMultiSelect =
False
If
.Show = -1
Then
saveFileName = .SelectedItems(1)
Application.DisplayAlerts =
False
wb.SaveAs saveFileName, FileFormat:=xlWorkbookNormal
Application.DisplayAlerts =
True
MsgBox
"File saved successfully."
, vbInformation
Else
MsgBox
"File not saved."
, vbInformation
Exit
Sub
End
If
End
With
End
Sub