Ich möchte bitte gerne im unteren Code der UF, das nach - MsgBox "Werte wurden eingetragen!"
Das die Arbeitsmappe gespeichert wird.
Wenn möglich ohne " Möchten sie die vorhandene Datei ersetzen."
Könnte mir dazu bitte jemand weiterhelfen.
Gruß
Heinz
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Sheets("Artikeln").Unprotect Password:="print"
Dim A As Long, myRow
If TextBox27 = "" Then
MsgBox "Es wurde keine SAP Nummer eingegeben." ', vbCritical
TextBox27.SetFocus
TextBox27.Text = ""
TextBox29.Text = ""
TextBox30.Text = ""
TextBox31.Text = ""
TextBox32.Text = ""
MsgBox "Es wurde nichts übernommen." ', vbCritical
Exit Sub
Else
With Worksheets("Artikeln") 'Anpassen
myRow = Application.Match(CSng(TextBox27), .Columns(1), 0)
If IsNumeric(myRow) Then
For A = 1 To 26
If IsNumeric(Me("ComboBox" & A)) Then
.Cells(myRow, A + 26) = CDbl(Me("ComboBox" & A).Value)
Else
.Cells(myRow, A + 26) = Me("ComboBox" & A).Value
End If
Next A
Else
MsgBox "SAP-Nr. " & TextBox27 & vbLf & "ist nicht vorhanden", vbCritical
MsgBox "Es wurde nichts übernommen." ', vbCritical
TextBox27.SetFocus
TextBox27.Text = ""
TextBox29.Text = ""
TextBox30.Text = ""
TextBox31.Text = ""
TextBox32.Text = ""
Exit Sub
End If
End With
End If
Sheets("Artikeln").Protect Password:="print"
MsgBox "Werte wurden eingetragen!"
'Unload Pruefung
For A = 1 To 26
Me("ComboBox" & A).Value = ""
Next A
TextBox27.SetFocus
TextBox27.Text = ""
TextBox29.Text = ""
TextBox30.Text = ""
TextBox31.Text = ""
TextBox32.Text = ""
Application.ScreenUpdating = True