P.S.: Řádek: Unload UserForm1 - můžeš zanedbat (smazat).
Kód: Vybrat vše
Private Sub CommandButton1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If Button = 1 Then
Dim Location As String, ThisFile As String
Location = "C:\TEXT\# DOKUMENT\# SEZNAM\LEXIKON\LEXIKON " & Format(Now(), "yyyy/mm/dd ")
If Shift = 2 Then ThisFile = Format(Time(), "hh-mm-ss") Else ThisFile = "NoAuthor"
ThisFile = Location + ThisFile & ".xls"
Unload UserForm1
Cells(1, 1).Select
ActiveWorkbook.SaveAs Filename:=ThisFile
End If
End Sub